forked from tjoskar/ng-lazyload-image
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.prod.config.js
38 lines (34 loc) · 1.1 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
const path = require('path');
const webpack = require('webpack');
const devWebpackConfig = require('./webpack.config');
const ENV = process.env.ENV = process.env.NODE_ENV = 'production';
module.exports = Object.assign({}, devWebpackConfig, {
devtool: 'source-map',
cache: false,
devServer: undefined,
output: {
path: path.resolve(__dirname, './example-dist'),
filename: '[name].bundle.js',
sourceMapFilename: '[name].js.map',
chunkFilename: '[id].chunk.js'
},
plugins: [
new webpack.optimize.OccurrenceOrderPlugin(true),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({
beautify: false,
mangle: {
screw_ie8 : true,
keep_fnames: true
},
compress: {
screw_ie8: true
},
comments: false
}),
new webpack.optimize.CommonsChunkPlugin({ name: ['main', 'vendor', 'polyfills'], minChunks: Infinity }),
new webpack.DefinePlugin({
ENV: JSON.stringify(ENV)
})
]
});