forked from linode/linode-api-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.prod.js
32 lines (30 loc) · 921 Bytes
/
webpack.config.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
var path = require('path');
var process = require('process');
var webpack = require('webpack');
var _ = require('./webpack.config.dev.js');
var _package = require('./package.json');
_.devtool = 'cheap-module-source-map';
_.entry = './src/index';
_.plugins = [
new webpack.optimize.CommonsChunkPlugin({
name: "common",
filename: "common.js",
}),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
},
'ENV_API_ROOT': JSON.stringify(process.env.API_ROOT),
'ENV_LOGIN_ROOT': JSON.stringify(process.env.LOGIN_ROOT),
'ENV_API_VERSION': JSON.stringify(process.env.API_VERSION),
'ENV_GA_ID': JSON.stringify(process.env.GA_ID),
'ENV_VERSION': JSON.stringify(_package.version)
}),
new webpack.optimize.UglifyJsPlugin({
compressor: {
warnings: false
}
}),
new webpack.optimize.AggressiveMergingPlugin()
];
module.exports = _;