feat(ssg): add ssg.experimentalExcludeRoutePaths#2405
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new experimental configuration option ssg.experimentalIgnoreRoutePaths to allow selective exclusion of routes from SSG rendering, replacing the previous experimentalLoose option. The feature enables large document sites to bypass SSG errors for specific pages by falling back to CSR rendering.
- Replaces
experimentalLooseboolean option withexperimentalIgnoreRoutePathsarray that accepts strings and RegExp patterns - Implements logic to filter routes and render ignored paths as CSR pages during the SSG process
- Updates documentation in both English and Chinese to reflect the API changes
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/shared/src/types/index.ts | Updates SSG configuration interface, replacing experimentalLoose with experimentalIgnoreRoutePaths |
| packages/shared/src/types/defaultTheme.ts | Adds missing @default false documentation for enableAppearanceAnimation |
| packages/document/rspress.config.ts | Updates theme configuration, replacing enableAppearanceAnimation with lastUpdated |
| packages/document/docs/zh/api/config/config-basic.mdx | Updates Chinese documentation for the new experimentalIgnoreRoutePaths option |
| packages/document/docs/en/api/config/config-basic.mdx | Updates English documentation for the new experimentalIgnoreRoutePaths option |
| packages/core/src/runtime/ssrServerEntry.tsx | Removes error handling logic related to deprecated experimentalLoose option |
| packages/core/src/node/ssg/renderPages.ts | Implements core logic for filtering routes and rendering CSR pages for ignored paths |
| packages/core/src/node/runtimeModule/runtimeConfig.ts | Removes SSG configuration from runtime exports |
✅ Deploy Preview for rspress-v2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for rspress ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Timeless0911
previously approved these changes
Jul 22, 2025
ssg.experimentalIgnoreRoutePathsssg.experimentalExcludeRoutePaths
Timeless0911
previously approved these changes
Jul 22, 2025
Timeless0911
approved these changes
Jul 22, 2025
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.

Summary
feat(ssg): add
ssg.experimentalExcludeRoutePathsexperimentalExcludeRoutePaths
(string | RegExp)[][]After enabled, some pages will not be rendered by SSG, and they will directly use html under CSR. This is suitable for SSG errors in large document sites bypassing a small number of pages. It is not recommended to enable this option actively.
Related Issue
Checklist