Skip to content

Commit

Permalink
fix: dynamic generation of swDest injection #11 (#12)
Browse files Browse the repository at this point in the history
Co-authored-by: Bun Colak <[email protected]>
  • Loading branch information
BunColak and Bun Colak authored Jan 6, 2021
1 parent e776a59 commit 542d37c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function VitePWA(options: Partial<VitePWAOptions> = {}): Plugin {
<script>
if('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('/sw.js', { scope: './' })
navigator.serviceWorker.register('${workbox.swDest.replace(outDir, '')}', { scope: './' })
})
}
</script>
Expand Down

0 comments on commit 542d37c

Please sign in to comment.