-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack-aot.config.js
96 lines (89 loc) · 2.02 KB
/
webpack-aot.config.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const BrotliPlugin = require('brotli-webpack-plugin');
const RemoveAssetsPlugin = require('remove-assets-webpack-plugin');
const ClosureCompilerPlugin = require('webpack-closure-compiler');
const Dashboard = require('webpack-dashboard');
const DashboardPlugin = require('webpack-dashboard/plugin');
const dashboard = new Dashboard();
module.exports = {
entry: {
app: './src/main-aot.ts'
},
output: {
filename: '[name].bundle.js',
sourceMapFilename: '[name].map',
chunkFilename: '[id].chunk.js'
},
resolve: {
extensions: ['.ts', '.js']
},
module: {
rules: [
{
test: /\.html$/,
exclude: /index\.html$/,
loader: 'ignore-loader'
},
{
test: /\.css$/,
loader: 'ignore-loader'
},
{
test: /\.ts$/,
use: [
{
loader: 'ng-router-loader',
options: {
aot: true,
genDir: 'aot'
}
},
'awesome-typescript-loader'
]
}
]
},
plugins: [
new DashboardPlugin(dashboard.setData),
new ClosureCompilerPlugin({
compiler: {
language_in: 'ECMASCRIPT5',
language_out: 'ECMASCRIPT5',
compilation_level: 'SIMPLE'
},
concurrency: 3
}),
new webpack.optimize.UglifyJsPlugin({
mangle: true,
comments: false,
sourceMap: false,
compress: {
screw_ie8: true,
warnings: false
}
}),
// new BrotliPlugin({
// asset: '[path].br[query]',
// minRatio: 1.0
// }),
//
// new RemoveAssetsPlugin(/\.js$/),
new HtmlWebpackPlugin({
title: 'Angular2 Compilation',
template: 'src/index.html',
chunks: [ 'app' ],
minify: {
caseSensitive: true
}
})
],
devServer: {
port: 8000,
host: 'localhost',
compress: true,
quiet: true,
inline: false,
historyApiFallback: true
}
};