From 038986d0b593b5aa172f6c1d2d19337ff0239e4c Mon Sep 17 00:00:00 2001 From: Alexander Petric Date: Mon, 27 Oct 2025 17:20:48 -0400 Subject: [PATCH] fix: fix windows bun bundler main.ts path detection (#6962) --- backend/windmill-worker/loader.bun.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/windmill-worker/loader.bun.js b/backend/windmill-worker/loader.bun.js index 857bc95573..289fac0a9a 100644 --- a/backend/windmill-worker/loader.bun.js +++ b/backend/windmill-worker/loader.bun.js @@ -15,8 +15,10 @@ const p = { const cdir = resolve("./"); const cdirNoPrivate = cdir.replace(/^\/private/, ""); // for macos + // On Windows, normalize path to POSIX format to match args.path from Bun's resolver + const cdirPosix = cdir.replace(/\\/g, "/").replace(/^[a-zA-Z]:/, ""); const filterResolve = new RegExp( - `^(?!\\.\/main\\.ts)(?!${cdir}\/main\\.ts)(?!(?:/private)?${cdirNoPrivate}\/wrapper\\.mjs).*\\.ts$` + `^(?!\\.\/main\\.ts)(?!${cdir}\/main\\.ts)(?!${cdirPosix}\/main\\.ts)(?!(?:/private)?${cdirNoPrivate}\/wrapper\\.mjs).*\\.ts$` ); let cdirNodeModules = `${cdir}/node_modules/`;