Add webpack config to exclude Node.js modules from client bundle
This commit is contained in:
1 parent
8735a0714e
commit
44a5e7d5ad
1 file changed
+11
@@ -25,6 +25,17 @@ const nextConfig = {
|
||||
bodySizeLimit: '2mb',
|
||||
},
|
||||
},
|
||||
webpack: (config, { isServer }) => {
|
||||
if (!isServer) {
|
||||
config.resolve.fallback = {
|
||||
...config.resolve.fallback,
|
||||
fs: false,
|
||||
path: false,
|
||||
crypto: false,
|
||||
}
|
||||
}
|
||||
return config
|
||||
},
|
||||
output: 'standalone',
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user