Skip to content

Commit

Permalink
chore: Use tsup for building backend
Browse files Browse the repository at this point in the history
  • Loading branch information
mohebifar committed Dec 22, 2024
1 parent 2acd600 commit 8c52d13
Show file tree
Hide file tree
Showing 4 changed files with 201 additions and 18 deletions.
3 changes: 2 additions & 1 deletion apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@codemod-com/backend",
"version": "0.0.163",
"scripts": {
"build": "tsc && node esbuild.config.js",
"build": "tsc && tsup",
"start": "node build/index.js",
"test": "vitest --run"
},
Expand All @@ -27,6 +27,7 @@
"nodemon": "3.0.2",
"supertest": "catalog:",
"ts-node": "10.9.2",
"tsup": "^8.3.5",
"tsx": "^4.7.1",
"vitest": "1.1.0"
},
Expand Down
2 changes: 0 additions & 2 deletions apps/backend/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import "dotenv/config";

import { startCronJobs } from "./cron.js";
import { runServer } from "./server.js";

Expand Down
14 changes: 14 additions & 0 deletions apps/backend/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { defineConfig } from "tsup";

export default defineConfig({
entryPoints: ["src/index.ts"],
format: ["esm"],
dts: false,
sourcemap: true,
clean: true,
minify: false,
splitting: true,
target: "node20",
bundle: true,
outDir: "build",
});
Loading

0 comments on commit 8c52d13

Please sign in to comment.