openzeppelin-contract-loader
openzeppelin-contract-loader copied to clipboard
Support loading contracts in a browser environment
Contract loader is currently designed to have filesystem access to load the artifacts. It would be nice if the same methods for loading artifacts in local tests could also be used when building a dapp.
We may want to look into loading the artifacts via require
s or similar so they play nicely with a bundler, such as webpack. And we should ensure that this API is compatible with that of the hot-loader, and discuss merging both projects if it makes sense.
Hey! Adding 2 cents here:
I assumed when reading the documentation that the contract-loader would do this (also be usable in a dapp). So, I was confused and tried to debug why it didn't work (the snag was caught in the usage of fs and found the answer here: https://stackoverflow.com/questions/58508257/nodejswebpackdocker-project-on-wsl-throwing-errors-with-native-fs-library).
There's no indications in the docs that it wouldn't support dapp usage. Perhaps it might be meaningful to specify this as to avoid others also going down the wrong direction.
Thanks for the suggestion @simondlr! I added a note on the readme and documentation site.