Skip to content

Commit 6dcf7b6

Browse files
committed
chore: resolve docker build issue
Add separate tsdown config for building server file
1 parent 82b18bc commit 6dcf7b6

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ USER node
1212
WORKDIR /app
1313

1414
# Files required by pnpm install
15-
COPY --chown=node package.json pnpm-lock.yaml tsdown.config.js tsconfig.json /app/
15+
COPY --chown=node package.json pnpm-lock.yaml tsdown.config.js tsdown.server.config.js tsconfig.json /app/
1616

1717
RUN pnpm install --frozen-lockfile
1818

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
],
2323
"scripts": {
2424
"build": "tsdown",
25-
"build:server": "tsdown src/server.ts --platform=node",
25+
"build:server": "tsdown --config tsdown.server.config.js",
2626
"check": "biome check && tsc",
2727
"format": "biome check --fix",
2828
"lint": "biome check",

tsdown.server.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { defineConfig } from "tsdown";
2+
3+
// Standalone server bundle (used by the Docker image).
4+
// Intentionally has no publint/dts: it's an executable bundle, not the
5+
// published package, so it doesn't need type declarations or package.json
6+
// export validation.
7+
export default defineConfig({
8+
entry: ["src/server.ts"],
9+
platform: "node",
10+
format: ["esm"],
11+
outDir: "dist",
12+
clean: true,
13+
splitting: false,
14+
sourcemap: true,
15+
});

0 commit comments

Comments
 (0)