diff --git a/scripts/build.ts b/scripts/build.ts index 98175b6..b1db608 100644 --- a/scripts/build.ts +++ b/scripts/build.ts @@ -22,8 +22,8 @@ const files = [ ].flat() const banner = [ - "process.env.BUILD = 'true'", - process.env.DOCKER === "1" ? "process.env.DOCKER = '1'" : null + "const bun__build = true", + process.env.DOCKER === "1" ? "const bun__docker = true" : null ].filter(v => typeof v === "string").join("\n") await Bun.build({ diff --git a/src/enviroment.d.ts b/src/enviroment.d.ts index 610fba6..8b47b85 100644 --- a/src/enviroment.d.ts +++ b/src/enviroment.d.ts @@ -16,4 +16,9 @@ declare global { } } +declare global { + const bun__build: boolean | undefined + const bun__docker: boolean | undefined +} + export {} diff --git a/src/utils/Illegitimate.ts b/src/utils/Illegitimate.ts index 20b875b..db10c82 100644 --- a/src/utils/Illegitimate.ts +++ b/src/utils/Illegitimate.ts @@ -7,8 +7,8 @@ import { log } from "./Logger" const client = new Client() const redis = new RedisClient(env.prod.REDISURI) -const ft = process.env.BUILD !== "true" ? "ts" : "js" -const dir = process.env.DOCKER !== "1" ? process.env.BUILD !== "true" ? "src" : "dist" : "" +const ft = bun__build !== true ? "ts" : "js" +const dir = bun__docker !== true ? bun__build !== true ? "src" : "dist" : "" class Illegitimate { async start() {