Skip to content
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

feat: experimental rolldown support #3211

Merged
merged 3 commits into from
Mar 11, 2025
Merged

feat: experimental rolldown support #3211

merged 3 commits into from
Mar 11, 2025

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Mar 11, 2025

This PR adds experimental support for rolldown bundler (for development and production nitro Builds) as a faster alternative to rollup.

In the next steps, we will add Vite support as a bundler as well (which allows using either vite as a standalone bundler or using Nitro as an environment build target for Vite).

Supporting both rolldown and vite is easy in the long term as both 3 share a common rollup plugin API.

This feature will be available initially on nitro-nightly channel and can be opted in using builder: "rolldown" config or NITRO_BUILDER=rolldown environment variable + installing rolldown peer dependency.

It is likely that all 3 rolldown, vite, and rollup become optional peer dependencies of Nitro so users can choose.

/cc @yyx990803 @hyf0 @IWANABETHATGUY @underfin @Boshen @shulaoda @sapphi-red


Current failing tests: (4/39)

pnpm test:rolldown test/presets/node.test.ts
  • JSX support (there is no neutral option to avoid react)
  • Static build flags (import.meta.dev, etc) plugin fails
  • Raw loader (rolldown wrongly processes \0path\to\asset.json and fails)
  • Externals bundled
  • Async context

Copy link

cloudflare-workers-and-pages bot commented Mar 11, 2025

Deploying nitrojs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6bdd2ca
Status: ✅  Deploy successful!
Preview URL: https://de5bc703.nitrojs.pages.dev
Branch Preview URL: https://feat-exp-rolldown.nitrojs.pages.dev

View logs

@pi0 pi0 marked this pull request as ready for review March 11, 2025 15:01
@pi0
Copy link
Member Author

pi0 commented Mar 11, 2025

(merging to iterate faster on v3 branch. feedbacks and contributions are more than welcome 🙏🏼 )

@pi0 pi0 merged commit eab51cf into v3 Mar 11, 2025
5 checks passed
@pi0 pi0 deleted the feat/exp-rolldown branch March 11, 2025 15:04
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