-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
43 lines (36 loc) · 1.2 KB
/
Copy pathnext.config.js
File metadata and controls
43 lines (36 loc) · 1.2 KB
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
34
35
36
37
38
39
40
41
42
43
const webpack = require("webpack");
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: false,
webpack: (config, { isServer }) => {
// Exclude canvas from bundle (Konva tries to import it for server-side rendering)
config.externals = [...(config.externals || []), { canvas: "canvas" }];
// Fix for wagmi/Reown AppKit SSR issues
if (!isServer) {
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
net: false,
tls: false,
};
}
// Externalize problematic SSR modules
if (isServer) {
config.externals.push("pino-pretty", "lokijs", "encoding");
}
// @x402/* are optional peer deps of @coinbase/cdp-sdk (pulled via @base-org/account)
config.plugins = [
...(config.plugins || []),
new webpack.IgnorePlugin({ resourceRegExp: /^@x402\// }),
];
// Ignore optional dependencies that cause warnings
config.ignoreWarnings = [
{ module: /node_modules\/@metamask\/sdk/ },
{ module: /node_modules\/pino/ },
{ module: /node_modules\/@walletconnect/ },
{ module: /node_modules\/idb-keyval/ },
];
return config;
},
};
module.exports = nextConfig;