-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathwebpack.aot.js
73 lines (70 loc) · 1.74 KB
/
webpack.aot.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
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
73
const helpers = require('./helpers');
const webpackMerge = require('webpack-merge');
const commonConfig = require('./webpack.common.js');
const DefinePlugin = require('webpack/lib/DefinePlugin');
const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin');
const UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin');
const ENV = process.env.NODE_ENV = process.env.ENV = 'production';
const PUBLIC_PATH = (process.env.PUBLIC_PATH || '') + '/';
module.exports = webpackMerge(commonConfig, {
entry: {
'main': './src/main.aot.ts'
},
module: {
rules: [
{
test: /\.ts$/,
loaders: [
'angular2-router-loader?loader=system&aot=true&genDir=aot/src/app',
],
},
]
},
devtool: 'source-map',
output: {
path: helpers.root('dist'),
filename: '[name].[chunkhash].js',
sourceMapFilename: '[name].[chunkhash].map',
chunkFilename: '[id].[chunkhash].chunk.js',
publicPath: PUBLIC_PATH,
},
plugins: [
new DefinePlugin({
'ENV': JSON.stringify(ENV),
}),
new LoaderOptionsPlugin({
minimize: true,
debug: false
}),
new UglifyJsPlugin({
beautify: false,
output: {
comments: false
},
mangle: {
screw_ie8: true
},
compress: {
screw_ie8: true,
warnings: false,
conditionals: true,
unused: true,
comparisons: true,
sequences: true,
dead_code: true,
evaluate: true,
if_return: true,
join_vars: true,
negate_iife: false, // we need this for lazy v8
},
}),
],
node: {
global: true,
crypto: 'empty',
process: false,
module: false,
clearImmediate: false,
setImmediate: false
}
});