Created
July 23, 2021 10:54
-
-
Save radjivF/f719f8a7e0284074ca61892b127c6714 to your computer and use it in GitHub Desktop.
Fixes npm packages that depend on `fs` module on NextJS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
webpack: (config, { isServer }) => { | |
// Fixes npm packages that depend on `fs` `net `empty` module | |
if (!isServer) { | |
config.node = { | |
fs: 'empty', | |
net: 'empty', | |
tls: 'empty' | |
} | |
} | |
return config | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment