Skip to content

Commit d7e3960

Browse files
committed
fix(bundler): update import map resolver for object property access.
1 parent 7269511 commit d7e3960

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pkg/@eser/laroux-bundler/import-map-resolver-plugin.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,18 +112,18 @@ async function resolveFromDenoModules(
112112
mainEntry = dotExport;
113113
} else if (typeof dotExport === "object") {
114114
const conditional = dotExport as Record<string, string>;
115-
mainEntry = conditional.import ?? conditional.module ??
116-
conditional.default ?? conditional.require;
115+
mainEntry = conditional["import"] ?? conditional["module"] ??
116+
conditional["default"] ?? conditional["require"];
117117
}
118118
}
119119
}
120120

121121
// 2. Fallback to module/main from raw config content (any loaded file)
122122
if (mainEntry === undefined) {
123123
for (const loadedFile of pkgConfig._loadedFiles) {
124-
const rawContent = loadedFile.content as Record<string, unknown>;
125-
const moduleField = rawContent.module as string | undefined;
126-
const mainField = rawContent.main as string | undefined;
124+
const rawContent = loadedFile.content;
125+
const moduleField = rawContent["module"] as string | undefined;
126+
const mainField = rawContent["main"] as string | undefined;
127127
mainEntry = moduleField ?? mainField;
128128
if (mainEntry !== undefined) break;
129129
}

0 commit comments

Comments
 (0)