forked from NewDadaFE/react-impression
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.prod.config.js
More file actions
executable file
·44 lines (43 loc) · 1.19 KB
/
webpack.prod.config.js
File metadata and controls
executable file
·44 lines (43 loc) · 1.19 KB
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
var path = require('path'),
webpack = require('webpack'),
HtmlWebpackPlugin = require('html-webpack-plugin'),
DashboardPlugin = require('webpack-dashboard/plugin');
module.exports = {
entry: './src/scripts/index',
output: {
path: path.join(__dirname, 'build', 'scripts'),
filename: 'app.js',
publicPath: '/'
},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': '"production"'
}),
new webpack.optimize.UglifyJsPlugin({
mangle: true,
compress: {
warnings: false,
},
comments: false,
mangle: {
except: ['$super', '$', 'exports', 'require', 'module']
}
}),
new webpack.optimize.MinChunkSizePlugin({minChunkSize: 51200}),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurrenceOrderPlugin(),
],
resolve: {
extensions: ['', '.js']
},
module: {
loaders: [{
test: /\.js$/,
loaders: ['babel'],
exclude: /node_modules/
},{
test: /\.(png|jpg)$/,
loader: 'url'
}]
}
};