File tree Expand file tree Collapse file tree 1 file changed +18
-7
lines changed
packages/start-plugin-core/src Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -207,17 +207,28 @@ export async function prerender({
207207 const contentType = res . headers . get ( 'content-type' ) || ''
208208 const isImplicitHTML =
209209 ! cleanPagePath . endsWith ( '.html' ) && contentType . includes ( 'html' )
210- // &&
211- // !JsonSigRx.test(dataBuff.subarray(0, 32).toString('utf8'))
210+
212211 const routeWithIndex = cleanPagePath . endsWith ( '/' )
213212 ? cleanPagePath + 'index'
214213 : cleanPagePath
215214
216- const htmlPath =
217- cleanPagePath . endsWith ( '/' ) ||
218- ( prerenderOptions . autoSubfolderIndex ?? true )
219- ? joinURL ( cleanPagePath , 'index.html' )
220- : cleanPagePath + '.html'
215+ const isSpaShell =
216+ startConfig . spa ?. prerender . outputPath === cleanPagePath
217+
218+ let htmlPath : string
219+ if ( isSpaShell ) {
220+ // For SPA shell, ignore autoSubfolderIndex option
221+ htmlPath = cleanPagePath + '.html'
222+ } else {
223+ if (
224+ cleanPagePath . endsWith ( '/' ) ||
225+ ( prerenderOptions . autoSubfolderIndex ?? true )
226+ ) {
227+ htmlPath = joinURL ( cleanPagePath , 'index.html' )
228+ } else {
229+ htmlPath = cleanPagePath + '.html'
230+ }
231+ }
221232
222233 const filename = withoutBase (
223234 isImplicitHTML ? htmlPath : routeWithIndex ,
You can’t perform that action at this time.
0 commit comments