mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-19 01:45:53 +00:00
fix(nitro): use generate:page
hook for browser to inject sw
resolves #522
This commit is contained in:
parent
cc428a60f1
commit
4cd6d80448
@ -53,11 +53,8 @@ if ('serviceWorker' in navigator) {
|
|||||||
serverDir: '{{ output.dir }}/public/_server'
|
serverDir: '{{ output.dir }}/public/_server'
|
||||||
},
|
},
|
||||||
nuxtHooks: {
|
nuxtHooks: {
|
||||||
'vue-renderer:ssr:templateParams' (params) {
|
'generate:page' (page) {
|
||||||
params.APP += script
|
page.html = page.html.replace('</body>', script + '</body>')
|
||||||
},
|
|
||||||
'vue-renderer:spa:templateParams' (params) {
|
|
||||||
params.APP += script
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
hooks: {
|
hooks: {
|
||||||
|
Loading…
Reference in New Issue
Block a user