diff --git a/backend/windmill-worker/loader_builder.bun.ts b/backend/windmill-worker/loader_builder.bun.ts index 4d7a2b48bf..eca8c9ef81 100644 --- a/backend/windmill-worker/loader_builder.bun.ts +++ b/backend/windmill-worker/loader_builder.bun.ts @@ -7,6 +7,8 @@ const bo = await Bun.build({ const fs = require("fs/promises"); +const captureVersion = /(^\@?[^\@]+)(?:\@(.+))?/; + if (!bo.success) { bo.logs.forEach((l) => console.log(l)); process.exit(1); @@ -17,7 +19,7 @@ if (!bo.success) { const { intersect } = require("semver-intersect"); const dependencies: Record = {}; for (const i of imports) { - let [name, version] = i.path.split("@"); + let [_, name, version] = i.path.match(captureVersion) ?? []; if (version == undefined) { if (dependencies[name] == undefined) { dependencies[name] = [];