UNPKG

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