aboutsummaryrefslogtreecommitdiff
path: root/scripts/build-prisma-client.js
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build-prisma-client.js')
-rw-r--r--scripts/build-prisma-client.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/build-prisma-client.js b/scripts/build-prisma-client.js
new file mode 100644
index 0000000..b5edc3d
--- /dev/null
+++ b/scripts/build-prisma-client.js
@@ -0,0 +1,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));