CryptoFile for browser
Hello.
I'm trying to build the lib for browser usage. I cloned the repo, npm i and then npx webpack in it. It's been built successfully but when I try to use it I get an error: TypeError: CryptoFile_1.default.randomBytes is not a function. I tried to debug a bit and it seems that webpack uses CryptoFile.ts instead of CryptoFile-Browser.ts and since node crypto module is not polyfilled we get an empty crypto module in the result.
So what's wrong with my attempt? What part of the code is responsible for mangling imported file names for different build targets?
Thanks in advance.
The easiest way is to download the npm browser pack. it will come with all the correct files.
if you want to use webpack then currently you'll have to rename the files yourself (or use a script that does it for you).
I managed to compile sources after renaming files. Thank you for your help
I managed to compile sources after renaming files. Thank you for your help
may I ask how you fixed this issue?
How do you fix this issue?