From 37c7e892d5998a513a35d4879fd969943d93f03c Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Fri, 20 Nov 2020 14:57:02 +0100 Subject: [PATCH] fix: add temp fix for browser --- packages/nitro/src/presets/browser.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/nitro/src/presets/browser.ts b/packages/nitro/src/presets/browser.ts index 64275712b1..1b5c4d42e1 100644 --- a/packages/nitro/src/presets/browser.ts +++ b/packages/nitro/src/presets/browser.ts @@ -32,7 +32,13 @@ if ('serviceWorker' in navigator) { tmpl.compiled = tmpl.compiled.replace('', script + '') }, async 'sigma:compiled' ({ output }: SigmaContext) { - await writeFile(resolve(output.publicDir, 'sw.js'), 'self.importScripts(\'/server/index.js\');') + await writeFile(resolve(output.publicDir, 'sw.js'), 'self.importScripts(\'/_server/index.js\');') + + // Temp fix + await writeFile(resolve(output.publicDir, 'index.html'), script) + await writeFile(resolve(output.publicDir, '200.html'), script) + await writeFile(resolve(output.publicDir, '404.html'), script) + consola.info('Ready to deploy to static hosting:', prettyPath(output.publicDir as string)) } }