File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
packages/vite/src/node/server Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -63,18 +63,18 @@ export async function transformRequest(
6363 const loadStart = isDebug ? Date . now ( ) : 0
6464 const loadResult = await pluginContainer . load ( id , ssr )
6565 if ( loadResult == null ) {
66+ // if this is an html request and there is no load result, skip ahead to
67+ // SPA fallback.
68+ if ( options . html && ! id . endsWith ( '.html' ) ) {
69+ return null
70+ }
6671 // try fallback loading it from fs as string
6772 // if the file is a binary, there should be a plugin that already loaded it
6873 // as string
6974 try {
7075 code = await fs . readFile ( file , 'utf-8' )
7176 isDebug && debugLoad ( `${ timeFrom ( loadStart ) } [fs] ${ prettyUrl } ` )
7277 } catch ( e ) {
73- // if this is an html request and there is no load result, skip ahead to
74- // SPA fallback.
75- if ( options . html ) {
76- return null
77- }
7878 if ( e . code !== 'ENOENT' ) {
7979 throw e
8080 }
You can’t perform that action at this time.
0 commit comments