fix(nitro): use generate:page hook for browser to inject sw

resolves #522
This commit is contained in:
Pooya Parsa 2021-09-10 13:22:13 +02:00
parent cc428a60f1
commit 4cd6d80448

View File

@ -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: {