-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.cjs
41 lines (37 loc) · 908 Bytes
/
next.config.cjs
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
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
compiler: {
styledComponents: true,
},
images: {
domains: ["127.0.0.1", '54.211.229.147', "instasaw.optimalinfographics.com"],
unoptimized: true,
},
// Define the node property and set fs to empty
node: {
fs: "empty",
},
};
module.exports = (phase, { defaultConfig }) => {
return {
...nextConfig,
webpack: (config, { isServer }) => {
if (!isServer) {
// Add a rule to handle "node:" URIs
config.module.rules.push({
test: /node_modules[\\/](@web5[\\/]api)[\\/].+\.js$/,
use: config.module.rules[0].use, // Use the same Babel loader as the default one
});
}
// Ensure to set fallbacks for certain Node.js modules
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
path: false,
os: false,
};
return config;
},
};
};