rollup-plugin-npm-run
v1.0.2
Published
Simple rollup plugin to run an npm run script after the bundle is written.
Downloads
347
Readme
rollup-plugin-npm-run
Simple Rollup plugin to run an npm run script after the bundle is written.
Install
npm install rollup-plugin-npm-run
Using
Inside your Rollup config:
import npmRun from 'rollup-plugin-npm-run'
const watch = process.env.ROLLUP_WATCH
export default {
plugins: [
watch && npmRun('start')
]
// ... plus the rest
}
This will run npm run start
after every writeBundle
event in Rollup.
Pass in additional args, like npm run start -- --env dev
:
npmRun('start', [ '--', '--env', 'dev' ])
API npmRun(npmRunScript: String, [options: Object])
npmRunScript: String
- The npm script name, e.g.start
would be the same as runningnpm run start
.options: Object
- Pass optional settings.options.args: Array<String>
- Pass in an optional list ofargs
to thespawn
process.
License
Published and released with ❤️ under the Very Open License