mirror of https://github.com/webpack/webpack.git
cache HarmonyExportImportedDependency.getMode
This commit is contained in:
parent
bbcc5a8ebe
commit
0513a52df6
|
@ -178,6 +178,7 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
|
|||
this.otherStarExports = otherStarExports;
|
||||
this.strictExportPresence = strictExportPresence;
|
||||
this.allStarExports = allStarExports;
|
||||
this._getMode = this._getMode.bind(this);
|
||||
}
|
||||
|
||||
// TODO webpack 6 remove
|
||||
|
@ -222,6 +223,15 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
|
|||
* @returns {ExportMode} the export mode
|
||||
*/
|
||||
getMode(moduleGraph, runtime) {
|
||||
return moduleGraph.cached(this._getMode, runtime);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {ModuleGraph} moduleGraph the module graph
|
||||
* @param {RuntimeSpec} runtime the runtime
|
||||
* @returns {ExportMode} the export mode
|
||||
*/
|
||||
_getMode(moduleGraph, runtime) {
|
||||
const name = this.name;
|
||||
const ids = this.getIds(moduleGraph);
|
||||
const parentModule = moduleGraph.getParentModule(this);
|
||||
|
|
Loading…
Reference in New Issue