-
Notifications
You must be signed in to change notification settings - Fork 13
/
webpack.prod.js
49 lines (48 loc) · 1.59 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
let webpack = require('webpack');
const merge = require('webpack-merge');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const common = require('./webpack.common.js');
let path = require('path');
module.exports = merge.smart(common, {
entry: {
'app': [
'bootstrap-loader', // Loads Twitter Bootstrap
'./index.jsx',
], // Appʼs entry point
'visor': path.join(__dirname, '/_visor/containers/VisorApp.jsx'),
},
output: {
path: path.join(__dirname, '/dist'),
publicPath: '/', // This is used to generate URLs to e.g. images
filename: 'prod/[name]-bundle.min.js',
},
devtool: 'cheap-module-source-map',
// devtool: 'cheap-module-eval-source-map', // for dev in prod enviroment
externals: {
ediphy_editor_params: 'ediphy_editor_params',
ediphy_editor_json: 'ediphy_editor_json',
},
plugins: [
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.optimize.ModuleConcatenationPlugin(),
new webpack.optimize.UglifyJsPlugin({
compressor: {
warnings: false,
screw_ie8: true,
conditionals: true,
unused: true,
comparisons: true,
sequences: true,
dead_code: true,
evaluate: true,
if_return: true,
join_vars: true,
},
}),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production'),
},
}),
],
});