1.0.2 • Published 3 years ago

rollup-plugin-npm-run v1.0.2

Weekly downloads
-
License
VOL
Repository
github
Last release
3 years ago

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 running npm run start.
  • options: Object - Pass optional settings.
  • options.args: Array<String> - Pass in an optional list of args to the spawn process.

License

Published and released with ❤️ under the Very Open License

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.0

3 years ago