packaging with webpack when a node_module imports 'fs'
06:39 02 Apr 2018

I'm building an isomorphic webapp and have a node_module that is being used both on the server and client.

On the server, a we package we are using imports fs but in the browser uses FileReader

The packages is included as a node module.

In my webpack, I have included

  node: {
        fs: 'empty'
    },

but still get an error in the browser saying cannot find module 'fs'

I've also tried in webpack exclude: /node_modules|fs/

how can I use this package and have webpack mock or ignore the fs module?

node.js webpack fs