-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.production.js
44 lines (35 loc) · 1.1 KB
/
webpack.config.production.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
44
var webpack = require( 'webpack' );
var ExtractTextPlugin = require( 'extract-text-webpack-plugin' );
var NodeExternals = require( 'webpack-node-externals' );
var config = require( './webpack.config.base' );
config.output.filename = 'index.js';
// Extract CSS modules.
config.module.loaders[1] = {
test: /.css$/,
loader: ExtractTextPlugin.extract( 'style', 'css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]' )
};
config.plugins = [
// Extract CSS modules.
new ExtractTextPlugin( 'react-recurring.min.css', {
allChunks: true
}),
// removes a lot of debugging code in React
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify( 'production' )
}
}),
// keeps hashes consistent between compilations
new webpack.optimize.OccurenceOrderPlugin(),
// minifies your code
new webpack.optimize.UglifyJsPlugin({
compressor: {
warnings: false
}
})
]
// Remove duplicated libraries when publishing.
config.externals = [
NodeExternals()
];
module.exports = config;