Skip to content

docs: clarify noExternals path patterns#4460

Open
vittorioexp wants to merge 1 commit into
nitrojs:mainfrom
vittorioexp:docs/no-externals-inlining
Open

docs: clarify noExternals path patterns#4460
vittorioexp wants to merge 1 commit into
nitrojs:mainfrom
vittorioexp:docs/no-externals-inlining

Conversation

@vittorioexp

Copy link
Copy Markdown
Contributor

Summary

Closes #3269.

Documents how noExternals array patterns work: they match resolved absolute module paths, not bare import specifiers. Adds monorepo and node_modules examples and a Nitro 2 externals.inline migration note.

Also updates the noExternals JSDoc in src/types/config.ts to match.

Test plan

  • Verified against src/build/config.ts and src/build/plugins/externals.ts
  • Docs-only change (plus JSDoc)

Document that noExternals array entries match resolved module paths, with monorepo and node_modules examples. Closes nitrojs#3269.
@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

@vittorioexp is attempting to deploy a commit to the Nitro Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Expanded noExternals documentation to explain Nitro’s default dependency externalization, boolean and pattern-based inlining, resolved absolute path matching, cross-platform patterns, and Nitro version equivalents.

Changes

noExternals documentation

Layer / File(s) Summary
Document noExternals behavior
docs/3.config/0.index.md, src/types/config.ts
Documents default node_modules externalization, true and array options, resolved module path matching, monorepo and cross-platform patterns, and Nitro 2/3 terminology.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title uses conventional commit format and accurately describes the docs change.
Description check ✅ Passed The description matches the docs and JSDoc updates for noExternals pattern clarification.
Linked Issues check ✅ Passed The docs cover the requested externals inlining guidance, default externalization, and workaround patterns for #3269.
Out of Scope Changes check ✅ Passed The changes stay within documentation and JSDoc updates aligned to the linked issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/3.config/0.index.md`:
- Line 1068: Update the documentation sentence about Nitro’s default dependency
externalization to qualify it as applying only to Node-compatible builds, or
explicitly state that it depends on nitro.options.node being true; keep the
existing explanation of inlined modules and alias configuration unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 089aebfe-2390-467d-8060-3bb70d8452c3

📥 Commits

Reviewing files that changed from the base of the PR and between c1ff6ba and 24e9f6a.

📒 Files selected for processing (2)
  • docs/3.config/0.index.md
  • src/types/config.ts

Comment thread docs/3.config/0.index.md
- Default: `false`{lang=ts}

Prevent specific packages from being externalized. Set to `true` to bundle all dependencies, or pass an array of package names/patterns.
By default, Nitro externalizes dependencies from `node_modules` for faster builds. Inlined modules are bundled into the output and can use your `alias` configuration.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Qualify the default externalization claim for non-Node builds.

src/build/plugins.ts:59-76 only enables the externals plugin when nitro.options.node is true; for edge/non-Node builds, this default externalization path is not enabled. Please say “Node-compatible builds” or document the node condition.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/3.config/0.index.md` at line 1068, Update the documentation sentence
about Nitro’s default dependency externalization to qualify it as applying only
to Node-compatible builds, or explicitly state that it depends on
nitro.options.node being true; keep the existing explanation of inlined modules
and alias configuration unchanged.

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.

More docs about externals inlining

1 participant