From 8d2ac1f3cdbffbba3cb68a233358fc4c1b8f8121 Mon Sep 17 00:00:00 2001 From: Jeffrey Posnick Date: Mon, 9 Nov 2020 16:00:53 -0500 Subject: [PATCH] Increase Workbox's maximumFileSizeToCacheInBytes --- packages/react-scripts/config/webpack.config.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index 8efff0b96c7..eddca1b0707 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -714,6 +714,10 @@ module.exports = function (webpackEnv) { swSrc, dontCacheBustURLsMatching: /\.[0-9a-f]{8}\./, exclude: [/\.map$/, /asset-manifest\.json$/, /LICENSE/], + // Bump up the default maximum size (2mb) that's precached, + // to make lazy-loading failure scenarios less likely. + // See https://github.com/cra-template/pwa/issues/13#issuecomment-722667270 + maximumFileSizeToCacheInBytes: 5 * 1024 * 1024, }), // TypeScript type checking useTypeScript &&