fix: rebuild windows bun loader main.ts filter from forward-slash cdir (#9946)

This commit is contained in:
Ruben Fiszel
2026-07-05 23:41:09 +02:00
committed by GitHub
parent b40b504513
commit a582e04bf4
@@ -32,7 +32,11 @@ const p = {
let cdirNodeModules = `${cdirFwd}/node_modules/`;
const filterLoad = new RegExp(`^${cdir}\/main\\.ts$`);
// Match the entry main.ts against bun's forward-slash resolver output on
// Windows — raw `cdir` carries backslashes that corrupt the regex, so the
// onLoad below would never fire and extensionless relative imports in
// main.ts would slip past filterResolve unrewritten.
const filterLoad = new RegExp(`^(?:${cdirFwd}|${cdirPosix})\/main\\.ts$`);
const transpiler = new Bun.Transpiler({
loader: "ts",
});