fs not found code example
Example 1: Error: Can't resolve 'fs' webpack
node: {
fs: 'empty'
}
Example 2: node require fs not found
module.exports = {
webpack: (config, { isServer }) => {
// Fixes npm packages that depend on `fs` module
if (!isServer) {
config.node = {
fs: 'empty'
}
}
return config
}
}