-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildAuth.js
More file actions
19 lines (18 loc) · 785 Bytes
/
buildAuth.js
File metadata and controls
19 lines (18 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { build } from "esbuild";
build({
entryPoints: ['./authorizer/index.ts','./authorizer/routes/index.ts','./authorizer/enums/index.ts'],
outdir: "./authorizer/dist",
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));