[2.x] perf: update Babel browserslist targets to reduce bundle size - #4932
Open
rafaucau wants to merge 2 commits into
Open
[2.x] perf: update Babel browserslist targets to reduce bundle size#4932rafaucau wants to merge 2 commits into
rafaucau wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR updates the browser targets in
babel.config.cjs:'>0.2%, not dead, not android > 0, not operamini all'to:
'>0.5%, last 2 versions, not dead, not operamini all'The new query raises the global usage threshold while explicitly retaining the latest two versions of each browser. This drops support for low-usage legacy browser versions and reduces unnecessary Babel transforms, while keeping broad compatibility with current browsers.
The explicit Android exclusion is also no longer necessary, since unsupported legacy versions are excluded by the remaining criteria.
Bundle size impact
Rebuilding
flarum/coreproduced the following results:dist/forum.jsdist/admin.jsBecause
flarum-webpack-configis shared across the ecosystem, extensions using this configuration can benefit from the updated targets when rebuilt.Ref: https://discuss.flarum.org/d/39653-are-we-supporting-too-old-browser