mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Use esbuild to build prisma client.
This commit is contained in:
parent
63e0873b5d
commit
6594c31a70
4 changed files with 25 additions and 5 deletions
|
|
@ -1,6 +1,9 @@
|
||||||
generator client {
|
generator client {
|
||||||
provider = "prisma-client"
|
provider = "prisma-client"
|
||||||
output = "../src/generated/prisma"
|
output = "../src/generated/prisma"
|
||||||
|
moduleFormat = "esm"
|
||||||
|
generatedFileExtension = "ts"
|
||||||
|
importFileExtension = "ts"
|
||||||
}
|
}
|
||||||
|
|
||||||
datasource db {
|
datasource db {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
generator client {
|
generator client {
|
||||||
provider = "prisma-client"
|
provider = "prisma-client"
|
||||||
output = "../src/generated/prisma"
|
output = "../src/generated/prisma"
|
||||||
|
moduleFormat = "esm"
|
||||||
|
generatedFileExtension = "ts"
|
||||||
|
importFileExtension = "ts"
|
||||||
}
|
}
|
||||||
|
|
||||||
datasource db {
|
datasource db {
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
"build-geo": "node scripts/build-geo.js",
|
"build-geo": "node scripts/build-geo.js",
|
||||||
"build-db-schema": "prisma db pull",
|
"build-db-schema": "prisma db pull",
|
||||||
"build-db-client": "prisma generate",
|
"build-db-client": "prisma generate",
|
||||||
"build-prisma": "tsc --project tsconfig.prisma.json",
|
"build-prisma-client": "node scripts/build-prisma-client.js",
|
||||||
"build-icons": "svgr ./src/assets --out-dir ./src/components/svg --typescript",
|
"build-icons": "svgr ./src/assets --out-dir ./src/components/svg --typescript",
|
||||||
"set-routes-manifest": "node scripts/set-routes-manifest.js",
|
"set-routes-manifest": "node scripts/set-routes-manifest.js",
|
||||||
"update-tracker": "node scripts/update-tracker.js",
|
"update-tracker": "node scripts/update-tracker.js",
|
||||||
|
|
|
||||||
14
scripts/build-prisma-client.js
Normal file
14
scripts/build-prisma-client.js
Normal 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));
|
||||||
Loading…
Add table
Add a link
Reference in a new issue