fix: add temp fix for browser

This commit is contained in:
Pooya Parsa 2020-11-20 14:57:02 +01:00
parent abf65f2176
commit 37c7e892d5

View File

@ -32,7 +32,13 @@ if ('serviceWorker' in navigator) {
tmpl.compiled = tmpl.compiled.replace('</body>', script + '</body>') tmpl.compiled = tmpl.compiled.replace('</body>', script + '</body>')
}, },
async 'sigma:compiled' ({ output }: SigmaContext) { 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)) consola.info('Ready to deploy to static hosting:', prettyPath(output.publicDir as string))
} }
} }