Skip to content

Commit

Permalink
fix: add temp fix for browser
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Nov 20, 2020
1 parent 1656155 commit d197716
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/presets/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ if ('serviceWorker' in navigator) {
tmpl.compiled = tmpl.compiled.replace('</body>', script + '</body>')
},
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))
}
}
Expand Down

0 comments on commit d197716

Please sign in to comment.