@@ -14,7 +14,8 @@ const Template = require("../Template");
1414const {
1515 InlinedUsedName,
1616 isExportInlined,
17- isInlineEnabled
17+ isInlineEnabled,
18+ isInlineExportsEnabled
1819} = require ( "../optimize/InlineExports" ) ;
1920const {
2021 getKnownExportNames,
@@ -45,7 +46,8 @@ const processExportInfo = require("./processExportInfo");
4546 * RawReferencedExports,
4647 * ReferencedExports,
4748 * TRANSITIVE,
48- * ExportInfoName
49+ * ExportInfoName,
50+ * UpdateHashContext
4951 * } from "../Dependency"
5052 */
5153/** @import { DependencyTemplateContext } from "../DependencyTemplate" */
@@ -59,6 +61,7 @@ const processExportInfo = require("./processExportInfo");
5961 * } from "../Module"
6062 */
6163/** @import ModuleGraph from "../ModuleGraph" */
64+ /** @import Hash from "../util/Hash" */
6265/**
6366 * @import ModuleGraphConnection, {
6467 * ConnectionState
@@ -830,6 +833,31 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
830833 } ;
831834 }
832835
836+ /**
837+ * Updates the hash with the data contributed by this instance.
838+ * @param {Hash } hash hash to be updated
839+ * @param {UpdateHashContext } context context
840+ * @returns {void }
841+ */
842+ updateHash ( hash , context ) {
843+ const { chunkGraph, runtime } = context ;
844+ const moduleGraph = chunkGraph . moduleGraph ;
845+ if ( ! isInlineExportsEnabled ( moduleGraph ) ) return ;
846+ const module = moduleGraph . getModule ( this ) ;
847+ if ( ! module || ! isInlineEnabled ( module ) ) return ;
848+ const mode = this . getMode ( moduleGraph , runtime ) ;
849+ if ( mode . type !== "normal-reexport" ) return ;
850+ const exportsInfo = moduleGraph . getExportsInfo ( module ) ;
851+ for ( const item of /** @type {NormalReexportItem[] } */ ( mode . items ) ) {
852+ if ( item . hidden || item . checked ) continue ;
853+ const usedName = exportsInfo . getUsedName ( item . ids , runtime ) ;
854+ if ( usedName instanceof InlinedUsedName ) {
855+ hash . update ( `${ item . name } :${ item . ids . join ( "." ) } :` ) ;
856+ usedName . updateHash ( hash ) ;
857+ }
858+ }
859+ }
860+
833861 /**
834862 * Gets module evaluation side effects state.
835863 * @param {ModuleGraph } moduleGraph the module graph
0 commit comments