Created by: r0ughnex
DESCRIPTION:
-
Resolves #6659 (closed): Updated the
workbox-webpack-plugin
from v3 to latest v4 and also tested some of the new configuration options such asskipWaiting
andcleanupOutdatedCaches
after ejecting the app. -
Resolves #6243 (closed): The new version automatically solves the issue where a registered service worker still tries to load an old resource, after workbox has cleaned up its old cache after an update.
TESTS COMPLETED:
-
Change the app code to
serviceWorker.register()
and runbuild
, then check if workbox caches the relevant files and if the service worker installs correctly and triggers theonSuccess
callback. -
Add flag
skipWaiting: true
to thewebpack.config.js
, then update the app code and perhaps also the version number inpackage.json
, then repeat the test above and check if the new service worker takes over the application and triggers theonUpdate
callback. Older outdated workbox caches should be deleted at the point (from logs visible on the dev console in localhost) -
Add flag
cleanupOutdatedCaches: false
, repeat the test above and check if the new service worker takes over the application. Older outdated workbox cache should not deleted now (this option is only available in versions 4.x.x and above).