fix: make assets array unique to prevent cache.addAll error
This commit is contained in:
parent
aeeb2b8b9a
commit
a6e8669f9b
1 changed files with 1 additions and 1 deletions
2
index.js
2
index.js
|
@ -77,7 +77,7 @@ export default function serviceWorker(config) {
|
|||
injectScript('page', registrationScript);
|
||||
},
|
||||
'astro:build:ssr': ({ manifest }) => {
|
||||
assets = manifest.assets.filter(ass => !ass.includes('sw.js'))
|
||||
assets = [...new Set(manifest.assets ?? [])].filter(ass => !ass.includes('sw.js'))
|
||||
},
|
||||
'astro:build:done': async ({ dir }) => {
|
||||
const outFile = fileURLToPath(new URL('./sw.js', dir));
|
||||
|
|
Loading…
Reference in a new issue