From ba24a3318ea969b80ed78f6b24d5bd1039423dec Mon Sep 17 00:00:00 2001 From: Viorel Cojocaru Date: Sat, 5 Jun 2021 18:50:38 +0200 Subject: [PATCH] Fix chunks setup (#2181) * build: Webpack config - use named chunk ids prevent invalidation across builds by using a deterministic chunkId algorithm * fix: Autotrack chunk name syntax --- app/index.js | 2 +- webpack.config.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/index.js b/app/index.js index cec7c16c..da02a5a7 100644 --- a/app/index.js +++ b/app/index.js @@ -79,7 +79,7 @@ window.addEventListener("load", async () => { if (!env.GOOGLE_ANALYTICS_ID || !window.ga) return; // https://github.com/googleanalytics/autotrack/issues/137#issuecomment-305890099 - await import(/** webpackChunkName "autotrack" */ "autotrack/autotrack.js"); + await import(/** webpackChunkName: "autotrack" */ "autotrack/autotrack.js"); window.ga("require", "outboundLinkTracker"); window.ga("require", "urlChangeTracker"); diff --git a/webpack.config.js b/webpack.config.js index 7bc65d0a..f5f8785d 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -97,6 +97,7 @@ module.exports = { optimization: { runtimeChunk: 'single', moduleIds: 'hashed', + chunkIds: 'named', splitChunks: { cacheGroups: { vendor: {