Closed afrancht closed 4 years ago
Hi! Indeed it will. As I suggested here, please include this in your webpack.config:
+ config.module.rules.push({
+ test: /\.wasm$/,
+ loaders: ['base64-loader'],
+ type: 'javascript/auto',
+ });
I am so sorry! I somehow missed that! Thank you so much. So from what I understood we are telling webpack to not parse wasm files as it would javascript files right? Since you have already compiled the wasm and somehow are able to execute it in the browser?
@afrancht there were several problems that I was fighting when crafting that config. I was writing a long comment, but then realized that it would be useful for everyone, so I added comments here, check it out: https://github.com/antelle/argon2-browser/blob/master/examples/webpack/webpack.config.js.
Using the
require
statement as suggested in the webpack example gives this the error bellow.Argon2 is only imported in: https://github.com/afrancht/wasm-reproduction/blob/master/components/LandingPage.js
I have tried other types of
import
found in other GitHub Issues but with no luck!Error:
Sorry for bothering again, @antelle :):