From 506ecdc0ff88b639d4dc23926d3d2b61f41ad59b Mon Sep 17 00:00:00 2001 From: Pan Date: Sun, 2 Jul 2017 21:20:21 +0800 Subject: [PATCH] split echarts into own file --- build/webpack.prod.conf.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js index 6f01fa59..112331d2 100644 --- a/build/webpack.prod.conf.js +++ b/build/webpack.prod.conf.js @@ -86,6 +86,14 @@ var webpackConfig = merge(baseWebpackConfig, { ) } }), + // split echarts into its own file + new webpack.optimize.CommonsChunkPlugin({ + async:'echarts', + minChunks(module) { + var context = module.context; + return context && (context.indexOf('echarts') >= 0 || context.indexOf('zrender') >= 0); + } + }), // extract webpack runtime and module manifest to its own file in order to // prevent vendor hash from being updated whenever app bundle is updated new webpack.optimize.CommonsChunkPlugin({