Skip to content

Conversation

@pi0
Copy link
Member

@pi0 pi0 commented Dec 18, 2025

No description provided.

@vercel
Copy link

vercel bot commented Dec 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
nitro.build Ready Ready Preview, Comment Jan 21, 2026 6:02pm

Request Review

@coderabbitai
Copy link

coderabbitai bot commented Dec 18, 2025

📝 Walkthrough

Walkthrough

Consolidates Rollup and Rolldown handling into a unified bundler abstraction: introduces getBundlerConfig, replaces ctx.rollupConfig with ctx.bundlerConfig, moves type exports into build.ts, and deletes the old getViteRollupConfig implementation. Changes adjust config merging, env exposure, and related types.

Changes

Cohort / File(s) Summary
Bundler core & plugin integration
src/build/vite/bundler.ts, src/build/vite/plugin.ts, src/build/vite/types.ts
Add getBundlerConfig; replace rollupConfig with bundlerConfig in plugin context and plugin flows; branch logic for Rollup vs Rolldown outputs; expose base build config.
Env & usage sites
src/build/vite/env.ts
Replace uses of ctx.rollupConfig with ctx.bundlerConfig; introduce build.rolldownOptions; wire rolldownConfig/rollupConfig from bundler config into environment.
Rolldown config merging
src/build/rolldown/config.ts
Extend merge order to include nitro.options.rolldownConfig, nitro.options.rollupConfig (back-compat cast), then existing config.
Removed legacy rollup implementation
src/build/vite/rollup.ts
Delete former getViteRollupConfig implementation (function removed).
Type reorganization
src/types/build.ts, src/types/config.ts, src/types/hooks.ts, src/types/index.ts
Move type exports to build.ts; add RolldownConfig type; add nitroOptions.rolldownConfig; update imports/exports to reflect new type locations; remove some legacy build types.
Defaults comment
src/config/defaults.ts
Documentation/comment change: "Rollup" → "Builder".

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess relevance to the changeset. Please add a description explaining the purpose and scope of the rolldownConfig feature changes, including motivation and any breaking changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: rolldownConfig' follows conventional commits format with proper type prefix and describes the main feature addition.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/rolldown-config

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 18, 2025

Open in StackBlitz

npm i https://pkg.pr.new/nitrojs/nitro@3887

commit: 5860fa5

@pi0 pi0 marked this pull request as ready for review January 21, 2026 17:36
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@src/build/vite/bundler.ts`:
- Around line 77-99: The current Rollup config creation in rollupConfig uses
defu with plugins: [inject(base.env.inject), alias({ entries: base.aliases })],
which overrides and drops any plugins present in commonConfig because defu does
not merge arrays; update the plugins value to explicitly concatenate
commonConfig.plugins (or an empty array) with the new plugins so base build
plugins (virtuals/replace/externals, etc.) are preserved — locate rollupConfig
and change the plugins assignment to merge commonConfig.plugins with
inject(base.env.inject) and alias({ entries: base.aliases }) (keep existing use
of defu, NODE_MODULES_RE, libChunkName, and other output settings intact).

In `@src/build/vite/plugin.ts`:
- Around line 184-186: The thrown Error message still says "Nitro rollup config"
while the code uses bundler terminology; update the message in the block that
checks ctx.bundlerConfig (the throw new Error(...) statement) to use consistent
phrasing such as "Nitro bundler config is not initialized yet." so it references
bundlerConfig instead of rollup config.

@pi0 pi0 merged commit 722efdc into main Jan 21, 2026
7 of 8 checks passed
@pi0 pi0 deleted the feat/rolldown-config branch January 21, 2026 18:00
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.

2 participants