File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
packages/vite/src/node/plugins Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -218,6 +218,7 @@ export function buildImportAnalysisPlugin(config: ResolvedConfig): Plugin {
218
218
219
219
if ( imports . length ) {
220
220
const s = new MagicString ( code )
221
+ const analyzed : Set < string > = new Set < string > ( )
221
222
for ( let index = 0 ; index < imports . length ; index ++ ) {
222
223
const { s : start , e : end , d : dynamicIndex } = imports [ index ]
223
224
// if dynamic import polyfill is used, rewrite the import to
@@ -234,6 +235,8 @@ export function buildImportAnalysisPlugin(config: ResolvedConfig): Plugin {
234
235
// literal import - trace direct imports and add to deps
235
236
const addDeps = ( filename : string ) => {
236
237
if ( filename === ownerFilename ) return
238
+ if ( analyzed . has ( filename ) ) return
239
+ analyzed . add ( filename )
237
240
const chunk = bundle [ filename ] as OutputChunk | undefined
238
241
if ( chunk ) {
239
242
deps . add ( config . base + chunk . fileName )
You can’t perform that action at this time.
0 commit comments