Build the dist files with Rolldown - #42758
Merged
Merged
Conversation
mdo
force-pushed
the
rolldown-dist
branch
2 times, most recently
from
July 28, 2026 00:38
bae39dd to
9f9996b
Compare
Rolldown is Rollup's native-speed successor and already sits in our lockfile through Vite and Astro, so the docs build uses it today. Moving our dist builds to it makes bundling about 35x faster and deletes tooling: the built-in `resolve.extensionAlias` replaces our custom ts-resolve plugin in this path, and the built-in transforms replace Babel, which applies zero transforms at our browser floors. Browser targets live in `build/browser-targets.mjs`; keep them in sync with `.browserslistrc`. Karma and the integration configs stay on Rollup and Babel until karma-rolldown-preprocessor ships a fix, so those dependencies remain. Output stays equivalent: identical exports, verbatim relative specifiers in js/dist, `process.env.NODE_ENV` replaced in the bundle, banner preserved through terser, and minified sizes within a fraction of a percent (slightly smaller). The unminified files change formatting wholesale in the rebuild commit; their bundlewatch budgets now carry slack that can ratchet down.
mdo
marked this pull request as ready for review
July 28, 2026 06:10
2 tasks
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.
Draft on purpose: queued behind #42724 and #42732. It stacks on #42732's branch and auto-retargets as the parents merge. Mark it ready after both land and a final rebase + rebuild.
Adopts the second proposal from #42620: build the dist files with Rolldown. Karma and the integration configs stay on Rollup until
karma-rolldown-preprocessorships an upstream fix.npm run jstime is still dominated by terser and tsc.resolve.extensionAliasreplaces our customrollup-plugin-ts-resolve.cjshere, and Rolldown's built-in transforms replace Babel — which applies zero transforms at our browser floors (verified: output is byte-identical with and without it). Both stay installed for Karma.build/browser-targets.mjswith a comment tying them to.browserslistrc, since Rolldown does not read browserslist.js/dist/*.js;process.env.NODE_ENVfully replaced in the bundle; banner survives terser; the build is deterministic (two runs, zero drift). Minified sizes are slightly smaller (32.64 vs 32.77 kB gzip standalone; 54.63 vs 54.77 kB bundle).dist/js/bootstrap.js— proves it is consumable ESM), the consumer type test (js-typecheck-dist), lint, typecheck, bundlewatch, and the docs build (the site consumes the new bundle through its@bootstrapalias).dist/js/distfiles change formatting wholesale in therebuildcommit (Rolldown's output style; ~19k insertions / ~25k deletions, net smaller). The unminified bundlewatch budgets now carry slack (41.6 kB actual vs 60.25 kB budget) and can ratchet down after merge.rolldownis pinned exactly (1.2.0) — pre-2.0 API drift is real; we saw an option move between minor versions during evaluation.References #42620.