diff --git a/src/module.ts b/src/module.ts index 90779dc..24873ba 100644 --- a/src/module.ts +++ b/src/module.ts @@ -25,6 +25,7 @@ import { log, PREDEFINED_LOG_MESSAGES } from "./package-utils/log-helpers"; import type { Prisma } from "@prisma/client"; interface ModuleOptions extends Prisma.PrismaClientOptions { + setupGlobalPrismaClientInLib: boolean; writeToSchema: boolean; formatSchema: boolean; runMigration: boolean; @@ -52,6 +53,7 @@ export default defineNuxtModule({ }, log: [], errorFormat: "pretty", + writeClientInLib: true, writeToSchema: true, formatSchema: true, runMigration: true, @@ -228,7 +230,9 @@ export default defineNuxtModule({ await prismaMigrateWorkflow(); } - await writeClientInLib(resolveProject("lib", "prisma.ts")); + if (options.setupGlobalPrismaClientInLib) { + await writeClientInLib(resolveProject("lib", "prisma.ts")); + } if (options.generateClient) { await generateClient(PROJECT_PATH, options.installClient);