-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
58 lines (49 loc) · 1.36 KB
/
webpack.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
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin');
const UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin');
module.exports = {
entry: './src/index.ts',
output: {
path: '/dist',
filename: '[name].[chunkhash].bundle.js',
sourceMapFilename: '[name].[chunkhash].bundle.map'
},
resolve: {
extensions: ['.ts', '.js', '.json'],
// remove other default values
modules: ['node_modules']
},
module: {
rules: [
{
test: /\.ts$/,
loaders: ['ts-loader']
}
]
},
plugins: [
new HtmlWebpackPlugin({
template: 'index.html'
}),
new ContextReplacementPlugin(
// The (\\|\/) piece accounts for path separators in *nix and Windows
/angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/, 'src'
),
new UglifyJsPlugin({
beautify: false,
comments: true,
compress: true,
mangle: false
})
],
devServer: {
port: 3000,
host: 'localhost',
historyApiFallback: true,
watchOptions: {
aggregateTimeout: 300,
poll: 1000
},
outputPath: "/dist"
}
};