File tree 1 file changed +5
-5
lines changed
packages/vite/src/node/server
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(
63
63
const loadStart = isDebug ? Date . now ( ) : 0
64
64
const loadResult = await pluginContainer . load ( id , ssr )
65
65
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
+ }
66
71
// try fallback loading it from fs as string
67
72
// if the file is a binary, there should be a plugin that already loaded it
68
73
// as string
69
74
try {
70
75
code = await fs . readFile ( file , 'utf-8' )
71
76
isDebug && debugLoad ( `${ timeFrom ( loadStart ) } [fs] ${ prettyUrl } ` )
72
77
} 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
- }
78
78
if ( e . code !== 'ENOENT' ) {
79
79
throw e
80
80
}
You can’t perform that action at this time.
0 commit comments