Use esbuild to build prisma client.

This commit is contained in:
Mike Cao 2025-05-01 04:38:43 -07:00
parent 63e0873b5d
commit 6594c31a70
4 changed files with 25 additions and 5 deletions

View file

@ -0,0 +1,14 @@
import esbuild from 'esbuild';
esbuild
.build({
entryPoints: ['src/generated/prisma/client.ts'], // Adjust this to your entry file
bundle: true, // Bundle all files into one (optional)
outfile: 'dist/generated/prisma/client.js', // Output file
platform: 'node', // For Node.js compatibility
target: 'es2020', // Target version of Node.js
format: 'esm', // Use ESM format
sourcemap: true, // Optional: generates source maps for debugging
external: [], // Optional: Exclude external dependencies from bundling
})
.catch(() => process.exit(1));