diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js index b8fb071..4e1d53f 100644 --- a/build/webpack.base.conf.js +++ b/build/webpack.base.conf.js @@ -107,10 +107,6 @@ module.exports = { }, plugins: [ new NyanProgressPlugin(), // 进度条 - new webpack.optimize.CommonsChunkPlugin({ - // 公共代码分离打包 - names: ['vendor', 'mainifest'] - }), new webpack.DefinePlugin({ 'process.env': { // 这是给 React / Redux 打包用的 NODE_ENV: JSON.stringify('production') diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js index 86fe2f8..1a04c29 100644 --- a/build/webpack.prod.conf.js +++ b/build/webpack.prod.conf.js @@ -41,6 +41,10 @@ config.plugins.push( } }), new webpack.optimize.OccurenceOrderPlugin(), + new webpack.optimize.CommonsChunkPlugin({ + // 公共代码分离打包 + names: ['vendor', 'mainifest'] + }), new ExtractTextPlugin('[name].[contenthash:6].css', { allChunks : true // 若要按需加载 CSS 则请注释掉该行 }),