forked from Samitier/angular2Game
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
46 lines (44 loc) · 1.4 KB
/
webpack.config.js
File metadata and controls
46 lines (44 loc) · 1.4 KB
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
let release = process.argv.indexOf('--release') !== -1,
webpack = require('webpack'),
ExtractTextPlugin = require("extract-text-webpack-plugin"),
HtmlWebpackPlugin = require('html-webpack-plugin'),
plugins = [
new webpack.optimize.CommonsChunkPlugin({ name: ['app', 'vendor', 'polyfills'] }),
new ExtractTextPlugin("bundle.css", { allChunks: true }),
new HtmlWebpackPlugin({ template: './client/index.html', hash: true })
]
if (release) {
plugins.push(new webpack.optimize.UglifyJsPlugin({mangle:false}));
plugins.push(new webpack.NoErrorsPlugin());
plugins.push(new webpack.optimize.DedupePlugin());
}
module.exports = {
entry: {
polyfills: './client/polyfills',
vendor: './client/vendor',
app: "./client/app/main",
},
output: {
path: "./public",
publicPath: '/',
filename: "[name].bundle.js"
},
devtool: (release) ? '' : "source-map",
resolve: {
extensions: ['', '.js', '.ts']
},
plugins: plugins,
module: {
loaders: [
{
test: /\.ts/,
loaders: ['ts-loader'],
exclude: /node_modules/
},
{
test: /(\.less|\.css)$/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader?minimize!less-loader?minimize!"),
}
]
}
}