Repository navigation
docs: add default behavior reference - #1917
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Deploying rslib with
|
| Latest commit: |
8badb4a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ffae7941.rslib.pages.dev |
| Branch Preview URL: | https://david-docs-default-behavior.rslib.pages.dev |
There was a problem hiding this comment.
🟢 Approval recommended
The changes are documentation-only and align with the linked issue’s goal; the remaining feedback is limited to minor reference-link polish.
Pull request overview
Adds a consolidated “Default behavior” reference (EN/ZH) to centralize Rslib’s library-build defaults and intentional deviations from Rsbuild/Rspack, and updates related docs to clarify format-dependent NODE_ENV replacement and the distinction between build-process NODE_ENV vs internal mode.
Changes:
- Add new “Default behavior / 默认行为” reference pages under the config overview (EN + ZH) with tables linking to relevant options.
- Clarify
process.env.NODE_ENVhandling across formats in the env-vars docs, including how pre-settingNODE_ENVaffects replacement vs how internalmodedrives optimizations. - Update related config docs (e.g.,
output.assetPrefix,output.filenameHash,output.target,lib.format) and navigation metadata to link to the new reference.
File summaries
| File | Description |
|---|---|
| website/docs/en/config/default-behavior.mdx | New consolidated default-behavior reference (EN). |
| website/docs/zh/config/default-behavior.mdx | New consolidated default-behavior reference (ZH). |
| website/docs/en/guide/advanced/env-vars.mdx | Clarifies format-dependent env replacement and NODE_ENV vs internal mode (EN). |
| website/docs/zh/guide/advanced/env-vars.mdx | Clarifies format-dependent env replacement and NODE_ENV vs internal mode (ZH). |
| website/docs/en/config/rsbuild/output.mdx | Documents format-dependent defaults (e.g., assetPrefix, filenameHash, target) (EN). |
| website/docs/zh/config/rsbuild/output.mdx | Documents format-dependent defaults (e.g., assetPrefix, filenameHash, target) (ZH). |
| website/docs/en/config/lib/format.mdx | Links lib.format to the consolidated default-behavior reference (EN). |
| website/docs/zh/config/lib/format.mdx | Links lib.format to the consolidated default-behavior reference (ZH). |
| website/docs/en/config/index.mdx | Adds a pointer from config overview to “Default behavior” (EN). |
| website/docs/zh/config/index.mdx | Adds a pointer from config overview to “默认行为” (ZH). |
| website/docs/en/config/_meta.json | Adds the new page to the EN config sidebar ordering. |
| website/docs/zh/config/_meta.json | Adds the new page to the ZH config sidebar ordering. |
Review details
- Files reviewed: 12/12 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Motivation
Rslib's library-specific defaults and differences from Rsbuild/Rspack are scattered across the docs, making output behavior easy to misinterpret.
Closes #1883.
Changes
Add an English and Chinese default behavior reference under the configuration overview, covering effective defaults, their rationale, and links to the options used to adjust them. Update related configuration and environment variable docs to clarify format-dependent behavior and distinguish the build process's
NODE_ENVfrom output replacement and buildmode.