From d7534be885ecfb91d6c7764e272e740caff4d507 Mon Sep 17 00:00:00 2001 From: Ken Berkeley Date: Mon, 17 Oct 2016 19:29:02 +0800 Subject: [PATCH] move commonsChunkPlugin into webpack.prod.conf.js --- build/webpack.base.conf.js | 4 ---- build/webpack.prod.conf.js | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) 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 则请注释掉该行 }),