mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33: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'
|
||||
},
|
||||
nuxtHooks: {
|
||||
'vue-renderer:ssr:templateParams' (params) {
|
||||
params.APP += script
|
||||
},
|
||||
'vue-renderer:spa:templateParams' (params) {
|
||||
params.APP += script
|
||||
'generate:page' (page) {
|
||||
page.html = page.html.replace('</body>', script + '</body>')
|
||||
}
|
||||
},
|
||||
hooks: {
|
||||
|
Loading…
Reference in New Issue
Block a user