1 | exports.name = 'builtin:shared-options'
|
2 |
|
3 | exports.apply = api => {
|
4 | api.hook('createCLI', ({ command }) => {
|
5 | command.option('-d, --out-dir <dir>', 'Output directory', {
|
6 | default: 'dist'
|
7 | })
|
8 |
|
9 | command.option('--no-progress', 'Disable default progress bar')
|
10 |
|
11 | if (api.isProd) {
|
12 | command.option('--source-map', 'Enable source map')
|
13 | } else {
|
14 | command.option('--no-source-map', 'Disable source map')
|
15 | }
|
16 |
|
17 | command.option('--parallel', 'Enable multicore compilation (experimental)')
|
18 |
|
19 | command.option('--cache', 'Enable compilation caching')
|
20 |
|
21 | command.option('--public-url <url>', 'Set the public URL to serve on', {
|
22 | default: '/'
|
23 | })
|
24 | command.option('--public-folder <folder>', 'Use a public folder', {
|
25 | default: 'public'
|
26 | })
|
27 | command.option('--no-public-folder', 'Disable public folder')
|
28 | command.option('--target <target>', 'Target environment', {
|
29 | default: 'browser'
|
30 | })
|
31 | command.option('--format <format>', 'Output format', { default: 'iife' })
|
32 | command.option('--module-name <name>', 'Module name for "umd" format')
|
33 | command.option('--file-names <filenames>', 'Customize output filenames')
|
34 | command.option('--no-clean', `Don't clean output directory before bundling`)
|
35 | command.option('--html <options>', 'Configure generated HTML file')
|
36 | command.option('--no-clear-console', `Don't clear console`)
|
37 |
|
38 | if (api.isProd) {
|
39 | command.option('--no-minimize', 'Disable minimization')
|
40 | } else {
|
41 | command.option('--minimize', 'Minimize output')
|
42 | }
|
43 | })
|
44 | }
|