-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.prod.js
37 lines (35 loc) · 1.01 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
/* eslint-disable import/no-extraneous-dependencies */
const merge = require('webpack-merge')
const webpack = require('webpack')
const common = require('./webpack.common.js')
const config = require('./config/production.json')
// More information:
// https://webpack.js.org/guides/production/
// https://medium.com/netscape/webpack-3-react-production-build-tips-d20507dba99a
module.exports = merge(common, {
devtool: 'cheap-module-source-map',
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production'),
CONFIG: JSON.stringify(config)
}),
new webpack.optimize.ModuleConcatenationPlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
screw_ie8: true,
conditionals: true,
unused: true,
comparisons: true,
sequences: true,
dead_code: true,
evaluate: true,
if_return: true,
join_vars: true
},
output: {
comments: false
}
})
]
})