From cb9e4a41e0e3631093487dd284d76ca3c1bc1bdd Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Wed, 8 Sep 2021 10:24:23 +0200 Subject: [PATCH] Merge pull request #4927 from overleaf/jpa-as-webpack-auto-code-splitting Change webpack code splitting strategy GitOrigin-RevId: 5af615db68e169942e1d37cd0251775cb68c568b --- services/web/webpack.config.js | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/services/web/webpack.config.js b/services/web/webpack.config.js index 3101d087cf..8bff72e0ab 100644 --- a/services/web/webpack.config.js +++ b/services/web/webpack.config.js @@ -231,21 +231,11 @@ module.exports = { }, }, - // Split out vendored dependencies that are shared between 2 or more "real - // bundles" (e.g. ide.js/main.js) as a separate "libraries" bundle and ensure - // that they are de-duplicated from the other bundles. This allows the - // libraries bundle to be independently cached (as it likely will change less - // than the other bundles) + // Split out files into separate (derived) bundles if they are shared between + // multiple (explicit) bundles, according to some webpack heuristics optimization: { splitChunks: { - cacheGroups: { - libraries: { - test: /[\\/]node_modules[\\/]|[\\/]frontend[\\/]js[\\/]vendor[\\/]libs[\\/]/, - name: 'libraries', - chunks: 'initial', - minChunks: 2, - }, - }, + chunks: 'all', }, },