Skip to content

[2.x] perf: update Babel browserslist targets to reduce bundle size - #4932

Open
rafaucau wants to merge 2 commits into
flarum:2.xfrom
rafaucau:chore/update-browserlist-config
Open

[2.x] perf: update Babel browserslist targets to reduce bundle size#4932
rafaucau wants to merge 2 commits into
flarum:2.xfrom
rafaucau:chore/update-browserlist-config

Conversation

@rafaucau

@rafaucau rafaucau commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

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/core produced the following results:

Asset Before After Saving
dist/forum.js 476 KB 440 KB 36 KB
dist/admin.js 464 KB 428 KB 36 KB

Because flarum-webpack-config is 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

@rafaucau
rafaucau requested a review from a team as a code owner August 13, 2026 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant