refactor: simpler ssr step
This commit is contained in:
parent
0cd090b442
commit
536372d895
1 changed files with 3 additions and 5 deletions
|
@ -122,12 +122,10 @@ declare const __prefix: string;`
|
||||||
injectTypes({filename: 'caching.d.ts', content: injectedTypes})
|
injectTypes({filename: 'caching.d.ts', content: injectedTypes})
|
||||||
},
|
},
|
||||||
'astro:build:ssr': ({ manifest }) => {
|
'astro:build:ssr': ({ manifest }) => {
|
||||||
const files = manifest.routes.map(route => route.file.replaceAll('/', ''));
|
|
||||||
const assetsMinusFiles = manifest.assets.filter(ass => !files.includes(ass.replaceAll('/', '')));
|
|
||||||
|
|
||||||
assets = output === 'static'
|
if (output !== 'static') {
|
||||||
? assetsMinusFiles
|
assets = manifest.assets
|
||||||
: manifest.assets.filter(ass => !ass.includes('sw.js'));
|
}
|
||||||
},
|
},
|
||||||
'astro:build:done': async ({ dir, routes, pages, logger }) => {
|
'astro:build:done': async ({ dir, routes, pages, logger }) => {
|
||||||
const outfile = fileURLToPath(new URL('./sw.js', dir));
|
const outfile = fileURLToPath(new URL('./sw.js', dir));
|
||||||
|
|
Loading…
Reference in a new issue