diff --git a/build-worker.ts b/build-worker.ts index 623b5f98..5e2a6d5a 100644 --- a/build-worker.ts +++ b/build-worker.ts @@ -7,7 +7,11 @@ const buildSpinner = ora("Building").start(); await $`rm -rf dist && mkdir dist`; await build({ - entrypoints: ["entrypoints/worker/index.ts"], + entrypoints: [ + "entrypoints/worker/index.ts", + // HACK: Include to avoid cyclical import errors + "config.ts", + ], outdir: "dist", target: "bun", splitting: true, diff --git a/build.ts b/build.ts index b5e18771..a4ad17b2 100644 --- a/build.ts +++ b/build.ts @@ -14,6 +14,8 @@ const pluginDirs = await readdir("plugins", { withFileTypes: true }); await build({ entrypoints: [ "index.ts", + // HACK: Include to avoid cyclical import errors + "config.ts", "cli/index.ts", // Force Bun to include endpoints ...Object.values(routes), diff --git a/classes/media/url.ts b/classes/media/url.ts index 214f7a67..bd0e3302 100644 --- a/classes/media/url.ts +++ b/classes/media/url.ts @@ -1,6 +1,4 @@ -// HACK: Import like this to avoid circular dependency -// since ProxiableUrl is used in config.ts -const { config } = await import("~/config.ts"); +import { config } from "~/config.ts"; export class ProxiableUrl extends URL { private isAllowedOrigin(): boolean {