-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
61 lines (59 loc) · 1.46 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
59
60
61
var path = require('path');
var webpack = require('webpack');
var webpack_dev_server = require('webpack-dev-server');
var HtmlWebpackPlugin = require('html-webpack-plugin');
//const ENV = process.env.NODE_ENV = process.env.ENV = 'production';
//const ENV = process.env.NODE_ENV = process.env.ENV = 'test';
const ENV = process.env.NODE_ENV = process.env.ENV = 'development';
module.exports = {
entry: {
index: "./dev/boot.ts",
},
output: {
publicPath: '/app/bundle/',
path: './app/bundle',
filename: '[name].min.js',
chunkFilename: '[id].chunk.js'
},
devtool: 'source-map',
resolve: {
extensions: ['.js', '.ts'],
},
module: {
rules: [
{
test: /\.ts$/,
loaders: ['awesome-typescript-loader','angular2-template-loader','angular-router-loader'],
exclude: [/\.(spec|e2e|d)\.ts$/]
},
{
test: /\.html$/,
loader: 'raw-loader'
},
{
test: /\.css$/,
loader: 'raw-loader'
}
],
},
plugins: [
new webpack.ContextReplacementPlugin(
/angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
__dirname
),
new webpack.optimize.UglifyJsPlugin({
minimize: true,
mangle: false,
sourceMap: true,
compress: { warnings: false },
}),
new webpack.DefinePlugin({
'process.env': {
'ENV': JSON.stringify(ENV)
}
})
],
node: {
net: 'empty'
}
};