Skip to content
Source
Sign inSign up
TanStack/router

fix: fix output path for spa shell #5682

Mergedschiller-manuel(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/5682/headmerged by schiller-manuel(GitHub profile, opens in a new tab)

Showing 1 changed file with 18 additions and 7 deletions.

x
0 of 1 viewed, 1 left
18 additions and 7 deletionspackages/start-plugin-core/src/prerender.tsModified
View file
@@ -207,18 +207,29 @@
const contentType = res.headers.get('content-type') || ''
const isImplicitHTML =
!cleanPagePath.endsWith('.html') && contentType.includes('html')
- // &&
- // !JsonSigRx.test(dataBuff.subarray(0, 32).toString('utf8'))
+​
const routeWithIndex = cleanPagePath.endsWith('/')
? cleanPagePath + 'index'
: cleanPagePath
​
- const htmlPath =
- cleanPagePath.endsWith('/') ||
- (prerenderOptions.autoSubfolderIndex ?? true)
- ? joinURL(cleanPagePath, 'index.html')
- : cleanPagePath + '.html'
+ const isSpaShell =
+ startConfig.spa?.prerender.outputPath === cleanPagePath
​
+ let htmlPath: string
+ if (isSpaShell) {
+ // For SPA shell, ignore autoSubfolderIndex option
+ htmlPath = cleanPagePath + '.html'
+ } else {
+ if (
+ cleanPagePath.endsWith('/') ||