docs: add how to preserve module variables #1010
Merged
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
This pull request introduces several documentation updates and a minor configuration enhancement. The documentation changes improve clarity and add new examples for preserving module variables during builds, while the configuration update adds a new transformer for handling notation diffs in markdown processing.
Documentation Updates:
source.definein both English (website/docs/en/config/rsbuild/source.mdx) and Chinese (website/docs/zh/config/rsbuild/source.mdx) to highlight its use for injecting environment variables during build time. [1] [2]website/docs/en/guide/faq/features.mdx) and Chinese (website/docs/zh/guide/faq/features.mdx) explaining how to preserve module variables like__webpack_hash__in build outputs usingsource.define. [1] [2]Configuration Enhancement:
transformerNotationDifftransformer to the markdown configuration inwebsite/rspress.config.tsto support notation diffs alongside notation highlights. [1] [2]Related Links
#1000
Checklist