vue3-yuanma/scripts/dev.js
2018-10-23 11:59:16 -04:00

30 lines
696 B
JavaScript

/*
Run Rollup in watch mode for development.
To specific the package to watch, simply pass its name and the desired build
formats to watch (defaults to "global"):
```
# 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
```
*/
const execa = require('execa')
const { targets, fuzzyMatchTarget } = require('./utils')
const args = require('minimist')(process.argv.slice(2))
const target = fuzzyMatchTarget(args._[0] || 'vue')
const formats = args.formats || args.f
execa(
'rollup',
['-wc', '--environment', `TARGET:${target},FORMATS:${formats || 'global'}`],
{
stdio: 'inherit'
}
)