2018-09-20 00:21:00 +08:00
|
|
|
/*
|
|
|
|
Run Rollup in watch mode for development.
|
|
|
|
|
|
|
|
To specific the package to watch, simply pass its name and the desired build
|
2018-09-20 00:46:55 +08:00
|
|
|
formats to watch (defaults to "global"):
|
2018-09-20 00:21:00 +08:00
|
|
|
|
|
|
|
```
|
|
|
|
# name supports fuzzy match. will watch all packages with name containing "dom"
|
|
|
|
yarn dev dom
|
|
|
|
|
|
|
|
# specify the format to output
|
|
|
|
yarn dev core --formats cjs
|
2019-05-29 10:34:07 +08:00
|
|
|
|
|
|
|
# Can also drop all __DEV__ blocks with:
|
|
|
|
__DEV__=false yarn dev
|
2018-09-20 00:21:00 +08:00
|
|
|
```
|
|
|
|
*/
|
2018-09-19 23:35:38 +08:00
|
|
|
|
|
|
|
const execa = require('execa')
|
|
|
|
const { targets, fuzzyMatchTarget } = require('./utils')
|
|
|
|
|
2018-09-20 00:21:00 +08:00
|
|
|
const args = require('minimist')(process.argv.slice(2))
|
2018-10-23 23:59:16 +08:00
|
|
|
const target = fuzzyMatchTarget(args._[0] || 'vue')
|
2018-09-20 00:21:00 +08:00
|
|
|
const formats = args.formats || args.f
|
2018-09-19 23:35:38 +08:00
|
|
|
|
|
|
|
execa(
|
|
|
|
'rollup',
|
2018-09-20 00:46:55 +08:00
|
|
|
['-wc', '--environment', `TARGET:${target},FORMATS:${formats || 'global'}`],
|
2018-09-19 23:35:38 +08:00
|
|
|
{
|
|
|
|
stdio: 'inherit'
|
|
|
|
}
|
|
|
|
)
|