-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.prod.babel.js
More file actions
43 lines (36 loc) · 938 Bytes
/
webpack.config.prod.babel.js
File metadata and controls
43 lines (36 loc) · 938 Bytes
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
import webpack from 'webpack';
import BundleTracker from 'webpack-bundle-tracker';
import UglifyJSPlugin from 'webpack-uglify-harmony';
import ExtractTextPlugin from 'extract-text-webpack-plugin';
import config from './webpack.config.base.babel';
config.devtool = 'source-map';
config.plugins = config.plugins.concat([
// Generate separate css files
new ExtractTextPlugin('[name].css'),
new BundleTracker({ filename: './webpack-stats-prod.json' }),
new webpack.DefinePlugin({
'process.env': { NODE_ENV: JSON.stringify('production') },
}),
// Minify JS
new UglifyJSPlugin({
sourceMap: true,
compressor: {
warnings: false,
},
}),
]);
config.module.rules.push(
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
use: [
{
loader: 'css-loader',
options: {
minimize: true,
},
},
],
}),
});
export default config;