-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.js
27 lines (26 loc) · 918 Bytes
/
build.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { build } from "esbuild";
build({
entryPoints: [
"./src/index.ts",
"./src/dependencies/index.ts",
"./src/exceptions/http.exception/*.ts",
"./src/handlers/index.ts",
"./src/routes/index.ts",
"./src/utility/index.ts",
"./src/resources/index.ts",
],
outdir: "dist/src",
bundle: true,
platform: "node",
// assetNames: 'dist/output/[name].[ext]',
// resolveExtensions:['.ts','.json'],
external: ["@aws-sdk/client-kms", "prisma", "@prisma/client", "aws-lambda","yup"], // This ensures aws-sdk is treated as an external dependency
outExtension: {
".js": ".mjs",
},
target: "ES2022", // or whatever your Node.js target version is
sourcemap: false,
format: "esm",
splitting: true, // Enable code splitting to generate separate output files
chunkNames: "./chunks/[name]-[hash]", // Optional: define naming pattern for chunks
}).catch(() => process.exit(1));