From 687e89f54f94d6d6ef21b09fbd9a1ab81a330a0e Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 5 Feb 2025 14:50:39 +0000 Subject: [PATCH] Fix hak script import in tsx esm for Windows (#2125) Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- scripts/hak/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/hak/index.ts b/scripts/hak/index.ts index 86ef2e18..7c5e3eee 100644 --- a/scripts/hak/index.ts +++ b/scripts/hak/index.ts @@ -90,7 +90,8 @@ async function main(): Promise { for (const s of HAKSCRIPTS) { if (hakJson.scripts?.[s]) { - const scriptModule = await import(path.join("file://", prefix, "hak", dep, hakJson.scripts[s])); + // Shockingly, using path.join and backslashes here doesn't work on Windows + const scriptModule = await import(`../../hak/${dep}/${hakJson.scripts[s]}`); if (scriptModule.default) { deps[dep].scripts[s] = scriptModule.default; } else {