-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.production.js
47 lines (40 loc) · 1017 Bytes
/
webpack.config.production.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
'use strict';
var webpack = require('webpack');
var config = require('./webpack.config.base.js');
var SaveAssetsJson = require('assets-webpack-plugin');
config.bail = true;
config.debug = false;
config.profile = false;
config.devtool = '#source-map';
config.output = {
path: './client/dist',
pathInfo: true,
publicPath: '/client/dist/',
filename: 'bundle.[hash].min.js'
};
config.plugins = config.plugins.concat([
new webpack.optimize.OccurenceOrderPlugin(true),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({
output: {
comments: false
},
compress: {
warnings: false,
screw_ie8: true
}
}),
new SaveAssetsJson({
path: process.cwd(),
filename: 'assets.json'
}),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production')
}
})
]);
config.module.loaders = config.module.loaders.concat([
{test: /\.jsx?$/, loaders: [ 'babel'], exclude: /node_modules/}
]);
module.exports = config;