fix(javascript): retain runtime scope in bundled module relationships

This commit is contained in:
dakjdakd
2026-10-10 21:42:21 +08:00
committed by Ysopwnable
parent 0d89978333
commit c1217e711b
14 changed files with 394 additions and 42 deletions
@@ -161,7 +161,7 @@ const addBundlerModuleNodes = (
],
});
context.moduleNodes.set(
moduleLookupKey(file.path, moduleValue.module_key),
moduleLookupKey(file.path, registration.runtime, moduleValue.module_key),
module,
);
addAstContainsEdge(context, {
@@ -195,7 +195,7 @@ const addBundlerRuntimeEdges = (
const { file, registration, chunk, coverage } = record;
for (const moduleKey of registration.entry_module_keys) {
const resolved = context.moduleNodes.get(
moduleLookupKey(file.path, moduleKey),
moduleLookupKey(file.path, registration.runtime, moduleKey),
);
const target =
resolved ?? unresolvedBundlerModuleNode(context, record, moduleKey);