https://github.com/diegohaz/webpack-spawn-plugin
A webpack plugin that runs child_process.spawn within compilation
https://github.com/diegohaz/webpack-spawn-plugin
child-process spawn webpack webpack-plugin
Last synced: 5 months ago
JSON representation
A webpack plugin that runs child_process.spawn within compilation
- Host: GitHub
- URL: https://github.com/diegohaz/webpack-spawn-plugin
- Owner: diegohaz
- License: mit
- Created: 2017-05-01T10:16:53.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-07-13T10:08:02.000Z (over 7 years ago)
- Last Synced: 2024-05-01T23:15:53.785Z (almost 2 years ago)
- Topics: child-process, spawn, webpack, webpack-plugin
- Language: JavaScript
- Homepage:
- Size: 120 KB
- Stars: 7
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# webpack-spawn-plugin
[](https://github.com/diegohaz/nod)
[](https://npmjs.org/package/webpack-spawn-plugin)
[](https://travis-ci.org/diegohaz/webpack-spawn-plugin) [](https://codecov.io/gh/diegohaz/webpack-spawn-plugin/branch/master)
A webpack plugin that runs `child_process.spawn` within compilation.
## Install
$ npm install --save-dev webpack-spawn-plugin
## Usage
```js
import SpawnPlugin from 'webpack-spawn-plugin'
const config = {
...
plugins: [
new SpawnPlugin('node', ['.'], options)
]
}
```
### Options
> `when` (default: "done")
The [Webpack compiler hook](https://webpack.js.org/api/compiler-hooks/#hooks)
during which the process will be spawned.
> `stdio` (default: "inherit")
The output stream to which stdout and stderr will be sent.
> `persistent` (default: false)
Indicates whether the spawned process should be replaced
every time the hook is called.
**Note**: You can pass more options to process.spawn in the `options` objects.
## License
MIT © [Diego Haz](https://github.com/diegohaz)