-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
30 lines (27 loc) · 961 Bytes
/
next.config.mjs
File metadata and controls
30 lines (27 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import createNextIntlPlugin from 'next-intl/plugin';
const withNextIntl = createNextIntlPlugin();
/** @type {import('next').NextConfig} */
const nextConfig = {
output: "standalone",
experimental: {
serverActions: {
allowedOrigins: [
process.env.NEXT_PUBLIC_BASE_URL
],
},
},
webpack: (config, { isServer }) => {
// Prevent webpack from bundling Node.js modules for the browser during build time
// '@dmptool/types' has conditional require() calls for 'fs' and 'path' that are only executed server-side,
// but webpack sees them during static analysis and tries to bundle them for the client-side, causing build errors.
if (!isServer) { // Only client-side build. 'fs' and 'path' doesn't work on client side anyway
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
path: false,
};
}
return config;
},
};
export default withNextIntl(nextConfig);