| 9 | const DEFAULT_FORMATS = ENABLE_MODERN ? 'modern,esm,cjs,umd' : 'esm,cjs,umd'; |
| 10 | |
| 11 | const cmd = type => (str, opts) => { |
| 12 | opts.watch = opts.watch || type === 'watch'; |
| 13 | |
| 14 | opts.entries = toArray(str || opts.entry).concat(opts._); |
| 15 | |
| 16 | if (typeof opts.compress !== 'undefined') { |
| 17 | // Convert `--compress true/false/1/0` to booleans: |
| 18 | if (typeof opts.compress !== 'boolean') { |
| 19 | opts.compress = opts.compress !== 'false' && opts.compress !== '0'; |
| 20 | } |
| 21 | } else { |
| 22 | // the default compress value is `true` for web, `false` for Node: |
| 23 | opts.compress = opts.target !== 'node'; |
| 24 | } |
| 25 | |
| 26 | handler(opts); |
| 27 | }; |
| 28 | |
| 29 | let prog = sade('microbundle'); |
| 30 | |