Skip to content

Commit

Permalink
Fix performance regression when a file is imported by many importers (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed Jun 17, 2020
1 parent cc2182d commit 472b4be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Graph.ts
Expand Up @@ -196,15 +196,15 @@ export default class Graph {
}
return {
dynamicallyImportedIds,
dynamicImporters: foundModule.dynamicImporters,
dynamicImporters: foundModule.dynamicImporters.sort(),
hasModuleSideEffects: foundModule.moduleSideEffects,
id: foundModule.id,
implicitlyLoadedAfterOneOf:
foundModule instanceof Module ? Array.from(foundModule.implicitlyLoadedAfter, getId) : [],
implicitlyLoadedBefore:
foundModule instanceof Module ? Array.from(foundModule.implicitlyLoadedBefore, getId) : [],
importedIds,
importers: foundModule.importers,
importers: foundModule.importers.sort(),
isEntry: foundModule instanceof Module && foundModule.isEntryPoint,
isExternal: foundModule instanceof ExternalModule
};
Expand Down
2 changes: 0 additions & 2 deletions src/ModuleLoader.ts
Expand Up @@ -294,7 +294,6 @@ export class ModuleLoader {
this.handleResolveId(await this.resolveId(source, module.id), source, module.id))
);
resolution.importers.push(module.id);
resolution.importers.sort();
}),
...module.dynamicImports.map(async dynamicImport => {
const resolvedId = await this.resolveDynamicImport(
Expand All @@ -312,7 +311,6 @@ export class ModuleLoader {
resolvedId
));
resolution.dynamicImporters.push(module.id);
resolution.dynamicImporters.sort();
}
})
]);
Expand Down

0 comments on commit 472b4be

Please sign in to comment.