1 | #!/usr/bin/env node
|
2 |
|
3 | 'use strict';
|
4 | const program = require('commander');
|
5 | const build = require('../runner/build');
|
6 | program
|
7 | .option(
|
8 | '-e, --entry [entry]',
|
9 | 'entry files (,) separated, glob mode , need to quote',
|
10 | val => {
|
11 | return val.split(',');
|
12 | }, ['index.html']
|
13 | )
|
14 | .option('--watch', 'watch mode')
|
15 | .option('--monitor', 'enable monitor')
|
16 | .option('--monitorurl [monitorurl]', 'monitor report url')
|
17 | .option('--monitorproduct [monitorproduct]', 'monitorproduct name')
|
18 | .option('--monitorpanel', 'enable monitorpanel')
|
19 | .option('--monitorfps', 'enable monitorfps')
|
20 | .option('--monitorerror', 'enable monitorerror')
|
21 | .option('--cdn [cdn]', 'static cdn domain')
|
22 | .option('--min [min]', 'min file', 'true')
|
23 | .option('--polyfill [polyfill]', 'add polyfill', 'true')
|
24 | .option('--hash [hash]', 'enable hash filename', 'true')
|
25 | .option('--library [library]', '设置包名称')
|
26 |
|
27 | .option('--target [target]', '设置包导出格式 , 可选值: `umd|amd|amd-require|commonjs2|this|window|global|commonjs|system|jsonp`')
|
28 | .option('--output [output]', 'output path', "dist")
|
29 | .option('--config [config]', 'config file , default ".ksr.conf.js"', '.ksr.conf.js')
|
30 | .option('-s, --static [static]', `static dir , 逗号分隔 , 默认是当前目录下的dist`, val => {
|
31 | return val.split(',');
|
32 | }, ['dist'])
|
33 | .parse(process.argv);
|
34 |
|
35 | build(program);
|