@@ -231,7 +231,7 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
231
231
throwOutdatedRequest ( importer )
232
232
}
233
233
234
- if ( ! imports . length ) {
234
+ if ( ! imports . length && ! ( this as any ) . _addedImports ) {
235
235
importerModule . isSelfAccepting = false
236
236
isDebug &&
237
237
debug (
@@ -263,7 +263,8 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
263
263
264
264
const normalizeUrl = async (
265
265
url : string ,
266
- pos : number
266
+ pos : number ,
267
+ forceSkipImportAnalysis : boolean = false
267
268
) : Promise < [ string , string ] > => {
268
269
url = stripBase ( url , base )
269
270
@@ -364,7 +365,7 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
364
365
const depModule = await moduleGraph . ensureEntryFromUrl (
365
366
unwrapId ( url ) ,
366
367
ssr ,
367
- canSkipImportAnalysis ( url )
368
+ canSkipImportAnalysis ( url ) || forceSkipImportAnalysis
368
369
)
369
370
if ( depModule . lastHMRTimestamp > 0 ) {
370
371
url = injectQuery ( url , `t=${ depModule . lastHMRTimestamp } ` )
@@ -667,7 +668,7 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
667
668
if ( pluginImports ) {
668
669
; (
669
670
await Promise . all (
670
- [ ...pluginImports ] . map ( ( id ) => normalizeUrl ( id , 0 ) )
671
+ [ ...pluginImports ] . map ( ( id ) => normalizeUrl ( id , 0 , true ) )
671
672
)
672
673
) . forEach ( ( [ url ] ) => importedUrls . add ( url ) )
673
674
}
0 commit comments