Skip to content

Commit

Permalink
fix(ci): add tsup config for vercel
Browse files Browse the repository at this point in the history
  • Loading branch information
jellydn committed Sep 24, 2023
1 parent 28b9b64 commit ee38dae
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"generate": "stepci generate ./specs/openapi.yaml ./specs/generated.yaml",
"start": "tsx app.ts",
"start:prod": "node dist/app.js",
"vercel-build": "tsup app.ts --clean --format cjs,esm --env.NODE_ENV production --env.DEPLOYMENT_ENV vercel --out-dir build"
"vercel-build": "tsup --config tsup-vercel.config.ts"
},
"dependencies": {
"@fastify/cors": "8.4.0",
Expand Down
14 changes: 14 additions & 0 deletions tsup-vercel.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { type Options } from "tsup";

const config: Options = {
entry: ["app.ts", "vercel/index.ts"],
clean: true,
format: ["cjs", "esm"],
env: {
NODE_ENV: "production",
DEPLOYMENT_ENV: "vercel",
},
outDir: "build",
};

export default config;
2 changes: 1 addition & 1 deletion vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"rewrites": [
{
"source": "/(.*)",
"destination": "/vercel/index.ts"
"destination": "/vercel/index.js"
}
]
}

0 comments on commit ee38dae

Please sign in to comment.