-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.prod.config.js
52 lines (47 loc) · 1.03 KB
/
webpack.prod.config.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
50
51
52
const webpack = require('webpack');
const merge = require('webpack-merge');
const loaders = require('./webpack/loaders.prod');
const baseWebpackConfig = require('./webpack.common.config');
const BundleAnalyzerPlugin = require('./webpack.bundle.config');
const devConfig = merge(baseWebpackConfig, {
name: "Webpack-Enterprise: Production",
devtool: "source-map",
output: {
filename: "pages/[name]/[name].[hash].js",
chunkFilename: 'pages/[name]/[name].[chunkhash].chunks.js',
},
resolve: {
alias: {
"vue": 'vue/dist/vue.min',
}
},
module: {
strictExportPresence: true,
rules: [
...loaders
]
},
plugins: [
new webpack.HashedModuleIdsPlugin(),
new webpack.optimize.UglifyJsPlugin({
beautify: false,
mangle: {
screw_ie8: true,
keep_fnames: true
},
compress: {
screw_ie8: true,
dead_code: true,
drop_console: true,
},
ie8: true,
comments: false,
sourceMap: true,
}),
BundleAnalyzerPlugin(),
],
performance: {
maxEntrypointSize: 300000,
},
});
module.exports = devConfig;