Skip to content

Commit 27847f0

Browse files
committed
chore(app): add PrismaPlugin to webpack configuration for server bundle
1 parent 092c35d commit 27847f0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

apps/app/next.config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
1+
import { PrismaPlugin } from '@prisma/nextjs-monorepo-workaround-plugin';
12
import { withBotId } from 'botid/next/config';
23
import type { NextConfig } from 'next';
34
import path from 'path';
5+
46
import './src/env.mjs';
57

68
const isStandalone = process.env.NEXT_OUTPUT_STANDALONE === 'true';
79

810
const config: NextConfig = {
11+
webpack: (config, { isServer }) => {
12+
if (isServer) {
13+
// Very important, DO NOT REMOVE, it's needed for Prisma to work in the server bundle
14+
config.plugins = [...config.plugins, new PrismaPlugin()];
15+
}
16+
17+
return config;
18+
},
919
// Use S3 bucket for static assets with app-specific path
1020
assetPrefix:
1121
process.env.NODE_ENV === 'production' && process.env.STATIC_ASSETS_URL

0 commit comments

Comments
 (0)