parcel-plugin-shell

Plugin to run shell commands before/after bundling process.

Usage no npm install needed!

<script type="module">
  import parcelPluginShell from 'https://cdn.skypack.dev/parcel-plugin-shell';
</script>

README

parcel-plugin-shell npm version

Plugin to run shell commands before/after bundling process.


【What is Parcel】

Installation

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

Configuration

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

License

This project is licensed under the MIT License - see the LICENSE file for details