This config works on a small project of mine, but I do need to add new packages to the list of fallbacks every once in a while. If used for a bigger project, you will likely have to add more fallbacks, as described. But I think this should cover the dependencies of hyper-sdk itself. Perhaps you can try out this config on another browser-based project of yours?
Note: webpack throws a big warning for the sodium-javascript package, which does an odd hack. I remember reading about it in some github issue, but can't pinpoint the conversation right now. The gist of it was that it is supposed to break in the browser, so I guess that's okay. But I haven't added it to the readme because I don't fully understand it and don't want to provide incorrect information.
WARNING in ./node_modules/sodium-javascript/randombytes.js 23:6-13
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
@ ./node_modules/sodium-javascript/index.js 27:8-32
@ ./node_modules/sodium-universal/index.js 1:0-41
@ ./node_modules/hypercore-crypto/index.js 1:15-42
@ ./node_modules/dat-sdk/index.js 9:15-42
@ ./Hyperdrive/01_Create_a_named_drive.js 11:12-30
This config works on a small project of mine, but I do need to add new packages to the list of fallbacks every once in a while. If used for a bigger project, you will likely have to add more fallbacks, as described. But I think this should cover the dependencies of hyper-sdk itself. Perhaps you can try out this config on another browser-based project of yours?
Note: webpack throws a big warning for the sodium-javascript package, which does an odd hack. I remember reading about it in some github issue, but can't pinpoint the conversation right now. The gist of it was that it is supposed to break in the browser, so I guess that's okay. But I haven't added it to the readme because I don't fully understand it and don't want to provide incorrect information.
The hack in question is:
Resolves #96