-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.prod.config.js
More file actions
34 lines (31 loc) · 918 Bytes
/
webpack.prod.config.js
File metadata and controls
34 lines (31 loc) · 918 Bytes
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
const webpack = require('webpack');
const webpackSettings = require('./webpack.config');
const optimizingPlugins = [
new webpack.DefinePlugin({ 'process.env.NODE_ENV': '"production"' }),
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.BannerPlugin('#!/usr/bin/env node', { raw: true }),
new webpack.optimize.UglifyJsPlugin({
minimize: true,
sourceMap: false,
mangle: { toplevel: true },
uglifyOptions: {
mangle: true,
toplevel: true,
keep_classnames: false,
keep_fnames: false,
},
compress: {
passes: 2,
},
output: {
beautify: false,
preamble: '/* uglified */',
},
}),
new webpack.optimize.DedupePlugin(),
];
webpackSettings.plugins = optimizingPlugins;
webpackSettings.entry = webpackSettings.entry.filter((entryName) => {
return entryName.indexOf('hot/dev-server') === -1;
});
module.exports = webpackSettings;