dev.js 705 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. Run Rollup in watch mode for development.
  3. To specific the package to watch, simply pass its name and the desired build
  4. formats to watch (defaults to "global"):
  5. ```
  6. # name supports fuzzy match. will watch all packages with name containing "dom"
  7. yarn dev dom
  8. # specify the format to output
  9. yarn dev core --formats cjs
  10. ```
  11. */
  12. const execa = require('execa')
  13. const { targets, fuzzyMatchTarget } = require('./utils')
  14. const args = require('minimist')(process.argv.slice(2))
  15. const target = fuzzyMatchTarget(args._[0] || 'renderer-dom')
  16. const formats = args.formats || args.f
  17. execa(
  18. 'rollup',
  19. ['-wc', '--environment', `TARGET:${target},FORMATS:${formats || 'global'}`],
  20. {
  21. stdio: 'inherit'
  22. }
  23. )