-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
64 lines (56 loc) · 1.42 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
62
63
64
// webpack.config.js
var path = require('path');
var webpack = require('webpack');
var CommonsChunkPlugin = webpack.optimize.CommonsChunkPlugin;
var UglifyJsPlugin = webpack.optimize.UglifyJsPlugin;
module.exports = {
devtool: 'source-map',
debug: false,
entry: {
'angular2': [
'rxjs',
'reflect-metadata',
'es6-promise',
'es6-shim',
'angular2/core',
'angular2/common',
'angular2/platform/browser',
'angular2/router',
'zone.js',
],
'app': './src/bootstrap.ts'
},
output: {
path: path.resolve(__dirname, 'build/app/'),
publicPath: 'build/app/',
filename: '[name].js',
sourceMapFilename: '[name].js.map',
chunkFilename: '[id].chunk.js'
},
resolve: {
extensions: ['', '.ts', '.js', '.json', '.css', '.html'],
},
module: {
loaders: [
{
test: /\.ts$/,
loader: 'ts',
exclude: [/build/, /dist/, /test/, /typings/, /node_modules(?![/\\]ng2-bootstrap)/]
},
{
test: /\.html$/,
loader: 'raw'
},
]
},
externals: [{
fs: 'require("fs")',
electron: 'require("electron")',
serialport: 'require("serialport")'
}],
plugins: [
new CommonsChunkPlugin({ name: 'angular2', filename: 'angular2.js', minChunks: Infinity }),
new CommonsChunkPlugin({ name: 'common', filename: 'common.js' }),
// new UglifyJsPlugin({ minimize: true, comments: false })
]
};