dev.js 761 B

1234567891011121314151617181920212223242526272829303132
  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. # Can also drop all __DEV__ blocks with:
  11. __DEV__=false yarn dev
  12. ```
  13. */
  14. const execa = require('execa')
  15. const { targets, fuzzyMatchTarget } = require('./utils')
  16. const args = require('minimist')(process.argv.slice(2))
  17. const target = fuzzyMatchTarget(args._[0] || 'vue')
  18. const formats = args.formats || args.f
  19. execa(
  20. 'rollup',
  21. ['-wc', '--environment', `TARGET:${target},FORMATS:${formats || 'global'}`],
  22. {
  23. stdio: 'inherit'
  24. }
  25. )