Skip to content

Commit 30314db

Browse files
committed
webpack: fix main.[hash].js not cached
This caused updates to not work if main.js was not in the browser cache since it was being excluded from the service worker. Issue: pybricks/support#689
1 parent e3fece1 commit 30314db

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
## [Unreleased]
66

7+
### Fixed
8+
- Fixed `main.[hash].js` not cached ([support#689]).
9+
10+
[support#689]: https://github.com/pybricks/support/issues/689
11+
712
## [2.0.0-beta.4] - 2022-07-28
813

914
### Added

config/webpack.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -716,12 +716,10 @@ module.exports = function (webpackEnv) {
716716
new WorkboxWebpackPlugin.InjectManifest({
717717
swSrc,
718718
dontCacheBustURLsMatching: /\.[0-9a-f]{8}\./,
719-
// REVISIT: main entry point should be chunked instead of ignored
720-
exclude: [/\.map$/, /asset-manifest\.json$/, /LICENSE/, /static\/js\/main\.\w+\.js$/],
721719
// Bump up the default maximum size (2mb) that's precached,
722720
// to make lazy-loading failure scenarios less likely.
723721
// See https://github.com/cra-template/pwa/issues/13#issuecomment-722667270
724-
maximumFileSizeToCacheInBytes: 2 * 1024 * 1024,
722+
maximumFileSizeToCacheInBytes: 10 * 1024 * 1024,
725723
}),
726724
// TypeScript type checking
727725
useTypeScript &&

0 commit comments

Comments
 (0)