🎉 What's New?
Build Tools
- Adds a new
navigationPreload
config property (defaulting tofalse
) toworkbox-build
'sgenerateSW
andgenerateSWString
modes, which would also expose it to the wrappers likeworkbox-cli
andworkbox-webpack-plugin
. [#1981]
workbox-core
-
Adds
workbox.core.cacheNames.prefix
andworkbox.core.cacheNames.suffix
for accessing the current prefix and suffix used in generating cache names. [#2001] -
Adds a new
cacheKeyWillBeUsed
lifecycle callback. This allows developers to override the default cache key for reads or writes (or both). [#1990]
The interface for the callback looks like:
async function cacheKeyWillBeUsed({request, mode}) {
// request is the default Request object that would otherwise be used as the cache key.
// mode is either 'read' or 'write', depending on whether it's a read or a write.
// Return either a string, or a Request whose url property will be used as the cache key.
// Returning the original request will make this a no-op.
}
🐛 What's Fixed?
workbox-webpack-plugin
- Convert source to Buffer when getting asset's hash, improving compatibility with some
webpack
loaders [#1966]. - Added sorting before generating a hash in the precache manifest. [#1973]
Thanks!
Special thanks to @merrywhether, @3846masa and @el for contributions that went into this release.