antelle / argon2-browser

Argon2 library compiled for browser runtime
https://antelle.net/argon2-browser
MIT License
367 stars 79 forks source link

Significance of config items in webpack example #43

Closed ferrantejake closed 4 years ago

ferrantejake commented 4 years ago

Hello!

I am implementing this package using webpack. The suggested values for the webpack config, specifically for the node parameter, are:

    // Error: Module not found: Error: Can't resolve 'fs'
    node: {
        __dirname: false,
        fs: 'empty',
        Buffer: false,
        process: false
    }

I was receiving the issue for "Can't resolve 'fs'". This configuration did fix the issue. I am curious why the parameters aside from fs: 'empty' are required/suggested. I removed them and it appears to still fix the issue. The reason this stood out to me is because I use process in some of my webpack config to import variables at build-time. Is this package incompatible with such configurations?

Thank you for taking the time to support this package :+1:

Best

antelle commented 4 years ago

Hi! There's an explanation here: https://github.com/antelle/argon2-browser/blob/master/examples/webpack/webpack.config.js#L21-L23