-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.prod.js
30 lines (29 loc) · 942 Bytes
/
webpack.prod.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
const common = require('./webpack.common.js');
const merge = require('webpack-merge');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const webpack = require('webpack');
const ManifestPlugin = require('webpack-manifest-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
module.exports = merge(common, {
// devtool: 'source-map',
plugins: [
new ManifestPlugin(),
new CleanWebpackPlugin(['static/build']),
new UglifyJSPlugin({ /* sourceMap: true */ }),
new webpack.DefinePlugin({
'process.env': {
BROWSER: JSON.stringify(true),
NODE_ENV: JSON.stringify(process.env.NODE_ENV || 'development')
}
})
],
module: {
rules: [
{
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: [/node_modules/, /public/]
}
]
}
});