Closed dylanseago closed 6 years ago
Yeah, that is some magic from emscripten that I could not remove when I tried
I remember I had some problems with that too, but then I solved it - I don't load fastxpub by worker loader at all, because worker-loader parses the .js and tries to put it through babel etc; in web wallet I just copy the file and use the worker directly (new Worker("./fastxpub.js")
)
I also do some terrible hacking here - https://github.com/trezor/hd-wallet/blob/master/test/discovery.js#L44 (I was glad I got it working in both node and karma)
Maybe it is possible to tell workerLoader to not do parsing of the js and just use it as is?
setting up emscripten + webworkers + wepack is hell
If it didn't add significant performance boost for the xpub generation, I would remove it, but it makes the math really fast :/
I was able to get rid of the error by adding this to my webpack config :)
node: {
fs: "empty"
}
Here's what I did to get this all working with webpack:
NICE! Thx for info
When using webpack worker-loader with fastxpub.js the following error message comes up during the build:
It looks like something that uses both fs and path is being included in the browserified output