New issue
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
Provide normalized options #3597
Conversation
Thank you for your contribution! ❤️You can try out this pull request locally by installing Rollup via
or load it into the REPL: |
Codecov Report
@@ Coverage Diff @@
## master #3597 +/- ##
==========================================
+ Coverage 96.30% 96.35% +0.04%
==========================================
Files 177 180 +3
Lines 6070 6140 +70
Branches 1787 1799 +12
==========================================
+ Hits 5846 5916 +70
+ Misses 112 111 -1
- Partials 112 113 +1
Continue to review full report at Codecov.
|
ca05b26
to
7948eb6
Compare
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Resolves #3018
Description
This completely refactors how options are handled internally. Basically there are now two types "NormalizedInputOptions" and "NormalizedOutputOptions" that represent a normalized view of the options with all defaults merged in.
All option validation, option normalization and applicable deprecation warnings have been moved to a central place. Internally, only the normalized options are passed around instead of putting them on various classes such as
Graph
.As a positive net effect for end users, the
buildStart
andrenderStart
hooks will now receive normalized options as well so there is no reason to hard-code any Rollup defaults in plugins.