From 63341e892bcbf11568fcf63668817c3243daef3d Mon Sep 17 00:00:00 2001 From: gunshiz Date: Mon, 28 Sep 2026 17:20:49 +0700 Subject: [PATCH] fix(discord) : resolve server-only worker bundle --- Dockerfile | 1 + tests/deployment-contract.test.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index 4632503..ad25afe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,7 @@ RUN bun build scripts/outbox-worker.ts \ --outfile=dist/outbox-worker.js && \ bun build backend/discord.ts \ --target=bun \ + --conditions=react-server \ --minify \ --outfile=dist/discord.js && \ bun build scripts/migrate.ts --target=bun --minify --outfile=dist/migrate.js diff --git a/tests/deployment-contract.test.ts b/tests/deployment-contract.test.ts index 7e339f7..6c0e2da 100644 --- a/tests/deployment-contract.test.ts +++ b/tests/deployment-contract.test.ts @@ -103,6 +103,9 @@ describe("production deployment contract", () => { "ENV NEXT_PUBLIC_GOOGLE_ADSENSE_CLIENT_ID=${NEXT_PUBLIC_GOOGLE_ADSENSE_CLIENT_ID}", ); expect(dockerfile).toContain("backend/discord.ts"); + expect(dockerfile).toMatch( + /bun build backend\/discord\.ts[\s\S]*?--conditions=react-server[\s\S]*?--outfile=dist\/discord\.js/u, + ); expect(dockerfile).toContain("./worker/discord.js"); });