We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🙋 feature request
When a library is required but parts of it are not used, I should be able to figure out how to remove the unused code from the bundle.
If a library is added with var abc = require('library'), unused JavaScript is not removed from the bundle by default.
npx create-choo-app and add web3 = require('web3') to index.js
The text was updated successfully, but these errors were encountered:
I don't know if we can safely do this because some modules rely on side effects. eg:
require('babel-polyfill') new WeakSet()
here babel-polyfill does not appear to be "used", but in old browsers the WeakSet global variable would not be available without that require call.
Sorry, something went wrong.
The solution in my case was to follow your good advice and find a different library with a better separation of concerns.
Requiring the specific export 'ethers/providers' perfectly removed unused/not required code in the 'ethers' library from the bundle.
Maybe docs could require the wording "not required" instead of "unused" where it makes sense? =)
No branches or pull requests
🙋 feature request
Expected Behavior
When a library is required but parts of it are not used, I should be able to figure out how to remove the unused code from the bundle.
Current Behavior
If a library is added with var abc = require('library'), unused JavaScript is not removed from the bundle by default.
Code Sample
npx create-choo-app and add web3 = require('web3') to index.js
Your Environment
The text was updated successfully, but these errors were encountered: