@@ -980,20 +980,20 @@ export default class Chunk {
980
980
}
981
981
982
982
private getDependenciesToBeDeconflicted (
983
- addDependencies : boolean ,
984
- addNonNamespaces : boolean ,
985
- interop : GetInterop ,
986
- addDependenciesWithoutBindings : boolean
983
+ addNonNamespacesAndInteropHelpers : boolean ,
984
+ addInternalDependencies : boolean ,
985
+ addDependenciesWithoutBindings : boolean ,
986
+ interop : GetInterop
987
987
) : DependenciesToBeDeconflicted {
988
988
const dependencies = new Set < Chunk | ExternalModule > ( ) ;
989
989
const deconflictedDefault = new Set < ExternalModule > ( ) ;
990
990
const deconflictedNamespace = new Set < ExternalModule > ( ) ;
991
- if ( addDependencies ) {
992
- for ( const variable of [ ... this . exportNamesByVariable . keys ( ) , ... this . imports ] ) {
993
- if ( addNonNamespaces || variable . isNamespace ) {
994
- const module = variable . module ! ;
995
- if ( module instanceof ExternalModule ) {
996
- dependencies . add ( module ) ;
991
+ for ( const variable of [ ... this . exportNamesByVariable . keys ( ) , ... this . imports ] ) {
992
+ if ( addNonNamespacesAndInteropHelpers || variable . isNamespace ) {
993
+ const module = variable . module ! ;
994
+ if ( module instanceof ExternalModule ) {
995
+ dependencies . add ( module ) ;
996
+ if ( addNonNamespacesAndInteropHelpers ) {
997
997
if ( variable . name === 'default' ) {
998
998
if ( defaultInteropHelpersByInteropType [ String ( interop ( module . id ) ) ] ) {
999
999
deconflictedDefault . add ( module ) ;
@@ -1003,11 +1003,11 @@ export default class Chunk {
1003
1003
deconflictedNamespace . add ( module ) ;
1004
1004
}
1005
1005
}
1006
- } else {
1007
- const chunk = this . chunkByModule . get ( module ) ! ;
1008
- if ( chunk !== this ) {
1009
- dependencies . add ( chunk ) ;
1010
- }
1006
+ }
1007
+ } else if ( addInternalDependencies ) {
1008
+ const chunk = this . chunkByModule . get ( module ) ! ;
1009
+ if ( chunk !== this ) {
1010
+ dependencies . add ( chunk ) ;
1011
1011
}
1012
1012
}
1013
1013
}
@@ -1238,10 +1238,10 @@ export default class Chunk {
1238
1238
deconflictChunk (
1239
1239
this . orderedModules ,
1240
1240
this . getDependenciesToBeDeconflicted (
1241
- format !== 'system' ,
1242
1241
format !== 'es' && format !== 'system' ,
1243
- interop ,
1244
- format === 'amd' || format === 'umd' || format === 'iife'
1242
+ format !== 'system' ,
1243
+ format === 'amd' || format === 'umd' || format === 'iife' ,
1244
+ interop
1245
1245
) ,
1246
1246
this . imports ,
1247
1247
usedNames ,
0 commit comments