aboutsummaryrefslogtreecommitdiffhomepage
path: root/esbuild.mjs
blob: f355f99c87bb9aceb650a45ff7980c90cbcce5b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import * as esbuild from "esbuild";

await esbuild.build({
	entryPoints: ["src/server/index.ts"],
	bundle: true,
	platform: "node",
	target: "node22",
	outfile: "dist/server/index.js",
	format: "esm",
	sourcemap: true,
	external: [
		// Node.js built-in modules
		"node:*",
		// Native modules that can't be bundled
		"argon2",
		"pg-native",
	],
	banner: {
		js: "import { createRequire } from 'module'; const require = createRequire(import.meta.url);",
	},
});

console.log("Server build complete: dist/server/index.js");