Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/h8ngrydev4hire/scripting-webpack-plugin
A Simple Webpack Plugin Built in Typescript For running scripts during compilation.
https://github.com/h8ngrydev4hire/scripting-webpack-plugin
build-tool cicd compilation-apps scripting typescript webpack
Last synced: 6 days ago
JSON representation
A Simple Webpack Plugin Built in Typescript For running scripts during compilation.
- Host: GitHub
- URL: https://github.com/h8ngrydev4hire/scripting-webpack-plugin
- Owner: h8ngryDev4Hire
- License: mit
- Created: 2024-10-19T19:31:08.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2024-10-27T17:03:06.000Z (about 2 months ago)
- Last Synced: 2024-10-27T19:56:14.492Z (about 2 months ago)
- Topics: build-tool, cicd, compilation-apps, scripting, typescript, webpack
- Language: TypeScript
- Homepage:
- Size: 8.15 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Scripting Webpack Plugin
A simple webpack extension built in Typescript for running scripts during the emission phase in Webpack's compilation process.
- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)## Features
### Scripting Language Support:
Supports running bash / python / js script files! simply declare what shell to execute your script in!
### Event-based Execution
Supports running scripts based on different compiler hook events. Currently support compiler hooks are as follows:
- onShouldEmit (`compiler.hooks.shouldEmit`)
- onEmit (`compiler.hooks.emit`)
- onAfterEmit (`compiler.hooks.afterEmit`)## Installation
### NPM Download
To install from npm, run the following cmds:
```bash
npm i -D scripting-webpack-plugin
```begin using in your `webpack.config.js` file as so:
```javascript
const ScriptingWebpackPlugin = require('scripting-webpack-plugin')
```### Github Download
To install from github, run the following cmds:
```bash
git clone
```Then install the dependencies:
```bash
npm i
```You can now compile your Typescript files by using:
```bash
tsc
```## Usage
A simple ScriptingWebpackPlugin configuration looks like the following:```javascript
const ScriptingWebpackPlugin = require('scripting-webpack-plugin')// ...
// Your Webpack Configuration...
// ...plugins: [
new ScriptingWebpackPlugin({
scripts: {
onEmit: [{
script: './scripts/build/chrome/build.sh',
args: 'target=chrome'
},{
shell: 'node',
script: './scripts/build/chrome/crx.js'
}],
onShouldEmit: [{
script: './scripts/performance/performance.sh',
args: 'threshold=5000ms'
}]
},
shell: 'bash',
verbose: true
})
]
```you can refer to the example `webpack.config.js` build file for more help!
## Contributing
We welcome contributions to the project! Please read our [Contributing Guidelines](CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.