-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunfile.js
More file actions
72 lines (60 loc) · 1.69 KB
/
Copy pathrunfile.js
File metadata and controls
72 lines (60 loc) · 1.69 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
const {run, help} = require('runjs');
const {removeDir, webpack} = require('./runfile-shared.js');
function clean_source() {
run('rimraf ./src/**/*.js && rimraf ./src/**/*.map && rimraf ./src/**/*metadata.json');
}
function clean() {
removeDir('dist');
removeDir('aot');
clean_source();
}
function aot_compile() {
clean();
run('ngc -p tsconfig-aot.json');
}
function start() {
run('webpack-dev-server -w --inline --progress --port 8080 --debug');
}
function test() {
run('karma start');
}
function lint() {
run('tslint src/**/*.ts{,x}');
}
const build = {
app() {
clean();
webpack('config/webpack.prod.js');
},
profile() {
removeDir('dist');
run('webpack --config config/webpack.prod.js --profile --json > app-bundle-stats.json');
},
vendor() {
removeDir('lib');
webpack('config/webpack.vendor.js');
},
vendorProfile() {
removedir('lib');
run('webpack --config config/webpack.vendor.js --profile --json > vendor-bundle-stats.json');
},
vendorProd() {
removeDir('lib');
webpack('config/webpack.vendor.prod.js');
}
}
help(clean, 'Remove distribution and AOT compilation directories');
help(start, 'Starts Webpack dev web server');
help(test, 'Runs automated tests');
help(lint, 'Runs TSLint');
help(build.app, 'Runs production build for application code');
help(build.vendor, 'Build vendor DLL without production optimizations');
help(build.vendorProd, 'Build vendor DLL with production optimizations');
module.exports = {
clean_source,
clean,
start,
test,
lint,
build
};