Put vendor in an own file in production
This commit is contained in:
parent
d32ee5ac36
commit
fb60ba496c
3 changed files with 18 additions and 5 deletions
|
|
@ -1,4 +1,5 @@
|
|||
const webpack = require('webpack');
|
||||
const path = require('path');
|
||||
const merge = require('webpack-merge');
|
||||
const common = require('./webpack.common.js');
|
||||
const ExtractTextPlugin = require("extract-text-webpack-plugin");
|
||||
|
|
@ -15,6 +16,10 @@ const extractCSS = ExtractTextPlugin.extract({
|
|||
});
|
||||
|
||||
module.exports = merge(common, {
|
||||
entry: {
|
||||
main: path.resolve(__dirname, 'src/index.jsx'),
|
||||
vendor: ['react', 'material-ui', 'mqtt', 'ramda']
|
||||
},
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /\.css$/, use: extractCSS },
|
||||
|
|
@ -28,6 +33,13 @@ module.exports = merge(common, {
|
|||
'process.env': {
|
||||
'NODE_ENV': JSON.stringify('production')
|
||||
}
|
||||
})
|
||||
}),
|
||||
new webpack.HashedModuleIdsPlugin(),
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'vendor'
|
||||
}),
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'runtime'
|
||||
}),
|
||||
]
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue