refactor top level declarations

- add topLevelDeclarations to code generation results
- set topLevelDeclarations=undefined if any child topLevelDeclarations=undefined
This commit is contained in:
Ivan Kopeykin 2022-02-07 17:29:38 +03:00
parent 58a2fd01c4
commit de7ec7bc07
1 changed files with 1 additions and 1 deletions

View File

@ -243,7 +243,7 @@ class AssignLibraryPlugin extends AbstractLibraryPlugin {
if (topLevelDeclarations.has(base))
return topLevelDeclarationContradictionError(base);
const { data } = codeGenerationResults.get(module, chunk.runtime);
topLevelDeclarations = data.get("topLevelDeclarations");
topLevelDeclarations = data && data.get("topLevelDeclarations");
if (topLevelDeclarations && topLevelDeclarations.has(base)) {
return topLevelDeclarationContradictionError(base);
}