aboutsummaryrefslogtreecommitdiff
path: root/scripts/build-prisma-client.js
blob: b5edc3dc7e621032c485efb044a34d07754bfa4c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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: '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: [
      '../src/generated/prisma', // exclude generated client
      '@prisma/client', // just in case
      '.prisma/client',
    ], // Optional: Exclude external dependencies from bundling
  })
  .catch(() => process.exit(1));