-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathwebpack.config.js
43 lines (38 loc) · 1.17 KB
/
webpack.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
const merge = require('webpack-merge');
const webpack = require('webpack');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const commonConfig = require('./webpack.common.config.js');
const publicConfig = {
devtool: 'cheap-module-source-map',
module: {
loaders: [
{test: /\.css$/, loader: ExtractTextPlugin.extract("style-loader", "css-loader")}
]
},
plugins: [
new CleanWebpackPlugin(['dist/*.*']),
new UglifyJSPlugin({
mangle: {
screw_ie8: false
},
mangleProperties: {
screw_ie8: false,
},
compress: {
screw_ie8: false,
},
output: {
screw_ie8: false
}
}),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}),
new ExtractTextPlugin('[name].[contenthash:5].css')
]
};
module.exports = merge(commonConfig, publicConfig);