forked from code4romania/civichq-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.prod.js
61 lines (60 loc) · 1.68 KB
/
webpack.prod.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 webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
const DefinePlugin = require('webpack/lib/DefinePlugin');
const UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin');
module.exports = {
entry: {
'polyfills': './src/polyfills.ts',
'vendor': './src/vendor.ts',
'app': './src/main.ts'
},
output: {
path: 'dist',
filename: '[name].js'
},
resolve: {
extensions: ['', '.js', '.ts']
},
//devtool: 'cheap-source-map',
module: {
loaders: [
{
test: /\.ts$/,
loader: 'ts!angular2-template'
},
{
test: /\.html$/,
loader: 'raw'
},
{
test: /\.(jpe|jpg|png|woff|woff2|eot|ttf|svg)(\?.*$|$)/,
loader: 'file?name=assets/[name].[hash].[ext]'
},
{
test: /\.css$/,
loader: 'style!css'
},
{
test: /\.scss$/,
loader: 'style!css!sass'
}
]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: ['app', 'vendor', 'polyfills']
}),
new HtmlWebpackPlugin({
template: './src/index.html'
}),
new UglifyJsPlugin({
beautify: false, //prod
mangle: { screw_ie8 : true, keep_fnames: true }, //prod
compress: { screw_ie8: true }, //prod
comments: false //prod
}),
new DefinePlugin({
SERVER_ADDRESS: JSON.stringify("http://api.centrucivic.ro/api/"),
})
]
};