daemon-command-webpack-plugin
Installing as a package
npm i daemon-command-webpack-plugin -S
or npm install daemon-command-webpack-plugin --save
Usage
{
"name": "me-app",
"version": "1.0.0",
"scripts": {
"start:dev:env": "node `pwd`/server/build/index.js",
"start:dev": "NODE_ENV=development PORT=3000 node `pwd`/server/build/index.js",
},
}
const DaemonCommandPlugin = require('daemon-command-webpack-plugin');
module.exports = {
plugins: [
new DaemonCommandPlugin('start:dev:env', {
env : {
NODE_ENV : 'development',
PORT : 3000
}
}),
new DaemonCommandPlugin('start:dev');
]
}
Arguments
command
<String> The package.json scripts command to runoptions
<Object>
cwd
<String> Current working directory of the child processenv
<Object> Environment key-value pairsuid
<Number> Sets the user identity of the processgid
<Number> Sets the group identity of the processdebounce
<Number> The number of milliseconds to debounce command start or restart
Use cwd
to specify the working directory from which the process is spawned. If not given, the default is to inherit the current working directory.
Use env
to specify environment variables that will be visible to the new process, the default is process.env.
License
MIT