From 8ba973ae03f57f851eec5f4887ba3c73609a9440 Mon Sep 17 00:00:00 2001 From: Andy Tsai Date: Mon, 26 Mar 2018 18:03:15 +0800 Subject: [PATCH] add split chunks --- src/containers/index.js | 2 +- webpack.config.base.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/containers/index.js b/src/containers/index.js index e65200e1..adbb4352 100644 --- a/src/containers/index.js +++ b/src/containers/index.js @@ -9,7 +9,7 @@ import NotFound from './NotFound'; const LoadComponent = loader => Loadable({ loader, loading: Loading, -}) +}); const Home = LoadComponent(() => import('./Home')); diff --git a/webpack.config.base.js b/webpack.config.base.js index e7381ba2..4c398dda 100644 --- a/webpack.config.base.js +++ b/webpack.config.base.js @@ -47,10 +47,15 @@ module.exports = { path.resolve(__dirname, 'node_modules/'), ] }, + optimization: { + splitChunks: { + chunks: 'all' + } + }, plugins: [ new HtmlWebPackPlugin({ template: path.resolve(__dirname, 'src/index.html'), filename: "./index.html" }) ] -}; \ No newline at end of file +};