Move terminal sessions to worker process

This commit is contained in:
Mohamed Boudra
2026-04-30 22:35:22 +07:00
parent 39f100b4bb
commit 4d840dafd4
10 changed files with 1126 additions and 4 deletions
@@ -0,0 +1,20 @@
import { existsSync } from "node:fs";
import { fileURLToPath } from "node:url";
export async function resolve(specifier, context, nextResolve) {
if (
context.parentURL?.startsWith("file:") &&
specifier.startsWith(".") &&
specifier.endsWith(".js")
) {
const candidateUrl = new URL(specifier.replace(/\.js$/, ".ts"), context.parentURL);
if (existsSync(fileURLToPath(candidateUrl))) {
return {
url: candidateUrl.href,
shortCircuit: true,
};
}
}
return nextResolve(specifier, context);
}