-
-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integration with create-react-app #38
Comments
Hi! I've just checked, removing |
@general-ice I'm encountering this same issue with create-react-app. Did you ever figure out a solution? |
@chris13524 Hi, Unfortunately,I have not found a good decision. We needed do it fast and used so-so way. All project bundled by webpack, but argon-browser we include via script tag in index.html and use it via global window scope. And if you find good way, please notify me. Thank. |
I just gave it a try, so what you need to do in the webpack.config, is the following:
{
test: /\.wasm$/,
loader: "base64-loader",
type: "javascript/auto",
},
noParse: /\.wasm$/,
/\.wasm$/ so that it looks something like exclude: [/\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/, /\.wasm$/] I assume @general-ice you were missing the last part, if it's not there, |
@antelle that works! 🎉 Thanks for looking into this! Here's the full config that worked for me: config.module.rules.push({
test: /\.wasm$/,
loader: "base64-loader",
type: "javascript/auto",
});
config.module.noParse = /\.wasm$/;
config.module.rules.forEach(rule => {
(rule.oneOf || []).forEach(oneOf => {
if (oneOf.loader && oneOf.loader.indexOf("file-loader") >= 0) {
oneOf.exclude.push(/\.wasm$/);
}
});
}); |
Added a link to the readme. |
I found same issue and
my change is as below.
Can you please help me and point to where I could change? |
I've figured out the problem. Latest push should be good. |
Hi, you made a good job. I've found a problem with
create-react-app
and i hope you help me)When i try use
argon2-browser
with my app, which was initialised fromcreate-react-app
. So thatcreate-react-app
has a only hide webpack config, i've usedreact-app-rewired
to customise it config. Problems: usageprocess: false
dont allowed in create-react-app, because some packadges depend from it, and also i common use theprocess
to acces env variables. If add your suggested config(withoutprocess
redefining), i have a error__webpack_public_path__ is not defined
. Example of problemcreate-react-app's
project bellowpackage.json:
config-overrides.js:
usage:
Thanks in advance
The text was updated successfully, but these errors were encountered: