-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
33 lines (30 loc) · 952 Bytes
/
next.config.ts
File metadata and controls
33 lines (30 loc) · 952 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
31
32
33
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
// Prevent webpack from trying to bundle ESM-only packages on the server side.
// These packages are only used in "use client" components so this is safe.
serverExternalPackages: [
"viem",
"wagmi",
"@wagmi/core",
"@reown/appkit",
"@reown/appkit-adapter-wagmi",
"ethers",
],
webpack: (config, { isServer }) => {
// Add node built-in fallbacks for browser bundles only.
// (required by some sub-packages of viem/ethers in the client bundle)
// Server bundles must NOT have these stubbed out — src/lib/utils/index.ts
// uses Node's crypto module (randomUUID, randomBytes) server-side.
if (!isServer) {
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
net: false,
tls: false,
crypto: false,
};
}
return config;
},
};
export default nextConfig;