forked from thednp/bootstrap.native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.js
executable file
·39 lines (35 loc) · 955 Bytes
/
build.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env node
// Native Javascript for Bootstrap 3 | Build Script
// Build script to bundle the js files in lib/V3
// Usage: npm run build
// Run node build.js --help for usage instructions
// by https://github.com/RyanZim
var { getModuleNames } = require('./lib/helpers');
var build = require('./build-module');
// Parse arguments:
var argv = require('yargs')
.usage('node build.js [--minify] [--ignore=<modules>...|--only=<modules>...]')
.options({
minify: {
alias: 'm',
type: 'boolean',
default: false,
describe: 'Minify output'
},
ignore: {
alias: 'i',
type: 'array',
describe: 'Omit the given module(s) from the bundle'
},
only: {
type: 'array',
describe: 'Only include the given module(s) in the bundle'
}
})
.coerce(['ignore', 'only'], getModuleNames)
.help()
.epilog(`Running without --ignore or --only will compile all the modules.
Writes to stdout`)
.argv;
argv.cli = true;
build(argv);