-
Notifications
You must be signed in to change notification settings - Fork 804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
workbox-build
: add option to handle dynamic routes when using generateSW
#2917
Comments
It's not obvious from the name, but you can configure the So the following is valid:
The trickier part about what you're trying to do is that you probably are not going to have access to the I am not eager to extend |
@jeffposnick with |
I'm not sure if this explains your issue, but using We have some development mode logging to catch this if you return a workbox/packages/workbox-routing/src/Router.ts Lines 344 to 354 in b47500c
|
This is not a bug, it is an enhancement for dynamic routes configuration.
Library Affected:
workbox-build:
generateSW
methodBrowser & Platform:
do not apply, it is a node module
Feature Request Description:
When building an SPA, using
generateSW
fromworkbox-build
module to build the service worker, there will be dynamic routes, for exampleuser/:id
: there is no way to configure dynamic navigation ongenerateSW
.For example, we only can add the SPA fallback,
generateSW
will generate this:It will be very usefull if we can use a new option, or expose
registerRoute
on configuration to serve the dynamic routes content.For example, I have a custom service worker using
injectManifest
to achieve the behavior:The main difference is to use a (simple or complex) configuration option entry instead writing a custom service worker, something like using
plugins
options onruntimeCaching
.You can see an example here: antfu-collective/vitesse#169
The text was updated successfully, but these errors were encountered: