Plugin to run shell commands before/after bundling process.
Parcel will automatically start using the plugin once its added to your package.json file.
To add the plugin to your existing project, run the below command.
npm i parcel-plugin-shell -D
or
yarn add parcel-plugin-shell -D
The plugin allows to configure the scripts that need to be executed. The supported parameters are as follows:
// package.json
{
...
"shell": {
"onBuildStart": [ "echo Starting Build" ],
"onBuildEnd": [ "node copy.js" ],
"onBuildExit": [ "npm run serve" ],
"dev": false,
"safe": false,
}
}
Parameter | Description | Default value |
---|---|---|
onBuildStart | Array of scripts to be executed before starting the bundling | [] |
onBuildEnd | Array of scripts to be executed after bundling completes | [] |
onBuildExit | Array of scripts to be executed once the entire build process finishes | [] |
dev | To disable execution of scripts in development mode | false |
safe | To switch script execution process from spawn to exec | false |
This project is licensed under the MIT License - see the LICENSE file for details