Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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
  }
}
Source by github.com #
 
PREVIOUS NEXT
Tagged: #node #require #fs
ADD COMMENT
Topic
Name
8+9 =