Skip to content

Commit 2c70e99

Browse files
committed
fix: write both paths
1 parent 61ef1b6 commit 2c70e99

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

modules/isr-fallback.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,15 @@ export default defineNuxtModule({
1515
nuxt.hook('nitro:init', nitro => {
1616
nitro.hooks.hook('compiled', () => {
1717
const spaTemplate = readFileSync(nitro.options.output.publicDir + '/200.html', 'utf-8')
18-
const outputPath = resolve(
19-
nitro.options.output.serverDir,
20-
'..',
21-
'spa.prerender-fallback.html',
22-
)
23-
writeFileSync(outputPath, spaTemplate)
18+
for (const path of ['package', '']) {
19+
const outputPath = resolve(
20+
nitro.options.output.serverDir,
21+
'..',
22+
path,
23+
'spa.prerender-fallback.html',
24+
)
25+
writeFileSync(outputPath, spaTemplate)
26+
}
2427
})
2528
})
2629
},

0 commit comments

Comments
 (0)