File tree 1 file changed +4
-2
lines changed
packages/vite/src/node/plugins 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -312,6 +312,7 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
312
312
str ( ) . prepend ( importsString )
313
313
str ( ) . overwrite ( expStart , endIndex , exp )
314
314
imports . forEach ( ( url ) => {
315
+ url = url . replace ( base , '/' )
315
316
importedUrls . add ( url )
316
317
if ( isEager ) staticImportedUrls . add ( url )
317
318
} )
@@ -411,10 +412,11 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
411
412
412
413
// record for HMR import chain analysis
413
414
// make sure to normalize away base
414
- importedUrls . add ( url )
415
+ const urlWithoutBase = url . replace ( base , '/' )
416
+ importedUrls . add ( urlWithoutBase )
415
417
if ( ! isDynamicImport ) {
416
418
// for pre-transforming
417
- staticImportedUrls . add ( url )
419
+ staticImportedUrls . add ( urlWithoutBase )
418
420
}
419
421
} else if ( ! importer . startsWith ( clientDir ) && ! ssr ) {
420
422
// check @vite -ignore which suppresses dynamic import warning
You can’t perform that action at this time.
0 commit comments