Execute a command after a successful Parcel build. This is useful when you want to e.g. automatically start your application when parcel watch
successfully built your application.
Install the plugin via yarn.
yarn add --dev parcel-reporter-exec
Alternatively, install it with npm.
npm install --save-dev parcel-reporter-exec
Create a .parcelrc
file in your project root.
touch .parcelrc
Paste the following content.
{
"extends": "@parcel/config-default",
"reporters": ["...", "parcel-reporter-exec"]
}
Update your package.json
.
{
// ...
"scripts": {
"dev": "PARCEL_EXEC=\"yarn start\" parcel watch --no-hmr",
"start": "node dist/index.js"
}
// ...
}