From d19771663b8312379b99b1d9b7fee245292f3134 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 --- src/presets/browser.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/presets/browser.ts b/src/presets/browser.ts index 64275712b1..1b5c4d42e1 100644 --- a/src/presets/browser.ts +++ b/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)) } }