From 5ef01ab9dd2b402c8b9d66f96c3a6c3d0be1fc96 Mon Sep 17 00:00:00 2001 From: Drake Leung Date: Wed, 3 May 2017 14:58:44 +0800 Subject: [PATCH] `count` in minChunks --- webpack.config.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/webpack.config.js b/webpack.config.js index 9354055..f134698 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -83,6 +83,13 @@ if (process.env.NODE_ENV === 'production') { ), }), + new webpack.optimize.CommonsChunkPlugin({ + async: 'used-twice', + minChunks: (module, count) => ( + count >= 2 + ), + }), + new webpack.DefinePlugin({ 'process.env': { NODE_ENV: '"production"'