Skip to content

Commit cd1bf68

Browse files
committed
generate prisma client into node_modules to build library with @prisma/client import
1 parent fc33eca commit cd1bf68

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,3 @@ yarn-error.log*
2222
.env
2323

2424
prisma/dev.db*
25-
# ignoring only for the library
26-
prisma/client/

prisma/schema.prisma

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ datasource db {
77

88
generator client {
99
provider = "prisma-client"
10-
output = "./client"
10+
// only generated to node_modules for the old @prisma/client import, to build the library
11+
output = "../node_modules/.prisma/client"
1112
}
1213

1314
model User {
1415
id Int @id @default(autoincrement())
1516
email String @unique
1617
name String?
17-
}
18+
}

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"baseUrl": "./",
1313
"incremental": true,
1414
"paths": {
15-
"@prisma/client": ["prisma/client/client.ts"]
15+
"@prisma/client": ["node_modules/.prisma/client/client.ts"]
1616
}
1717
}
1818
}

0 commit comments

Comments
 (0)