-
Notifications
You must be signed in to change notification settings - Fork 509
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
feat(service-worker): inject SW registeration script to all pages #299
Conversation
src/presets/service-worker.ts
Outdated
@@ -55,6 +49,11 @@ export const serviceWorker = defineNitroPreset(() => { | |||
preview: 'npx serve ./public' | |||
}, | |||
hooks: { | |||
'prerender:route' (route) { | |||
// TODO: use baseURL from nitro options | |||
const baseURL = '/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pi0 @danielroe Is there any way to access nitro
inside presets other than passing it to hook?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Presets are evaluated for constructing config. We might improve this by supporting lazy evaluated hooks but for now you can directly pass nireo
as second argument ππΌ
Any updates on this? |
@pi0 I updated hook signature and passed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for working on this.
π Linked issue
resolves #88
β Type of change
π Description
π Checklist