Closed ryan-mahoney closed 6 years ago
Another clue, when I build my project, it says:
[BABEL] Note: The code generator has deoptimised the styling of "/Users/ryanmahoney/Documents/ecommerce/app/node_modules/react-final-form-html5-validation/dist/react-final-form-html5-validation.es.js" as it exceeds the max of "500KB"
Removing react-final-form-html5-validation
(by just aliasing it to `react-final-form in my webpack config) shaves off ~100Kb!
That's pretty weird considering the actual code is < 3kb
. Bundlephobia confirms it's almost 100kb unzipped. It sure looks like the peer deps are properly specified as "external" in the rollup.config.js
. 🤔
Yeah, I wanted to be more helpful and open a PR w/ a fix, but I've not actually bundled a library with rollup before. Hope it's an easy fix, this is a great lib ;)
Fixed by #2
Will you be pushing a new version to NPM?
Are you submitting a bug report or a feature request?
Bug report
What is the current behavior?
The distributed builds are huge, for example, the
react-final-form-html5-validation.es.js
is 670kb. It also contains references to things like__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner
which doesn't seem right.What is the expected behavior?
This looks like a small library, the build should also be small.
Sandbox Link
What's your environment?
final-form: ^4.8.3
react-final-form-html5-validation: 1.0.0
Other information