Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
@0x/subproviders Doesn't Work With Angular 6 When Doing Production Builds For Client or Server #1195
Here is a simple repo, taken from the Angular Universal Starter: https://github.com/pointtoken/universal-starter/tree/0x
You'll see I added the 0x SubProviders library and try to instantiate it. I also had to deal with Angular not liking crypto with this hack
Which I learned about from here:
If I create a production build and just try to serve the browser files, it fails at runtime.
If I try to create a build that runs on the server (which runs a different webpack that targets node), it won't even build:
It seems like there is a lot of code in the subprovider library that isn't being shaken out -- could this library be made more modular? Or are there webpack tricks/hacks that need to be in place?
We're going to look into tree shaking better for the subproviders package. At the very least we should split out ganache-core (used in testing) from the rest of the subproviders.
Also had a bit of luck following this comment here, trufflesuite/ganache-cli#204 (comment).