Skip to content

docs: correct dynamic call to writeModule example#11650

Merged
chenjiahan merged 4 commits intomainfrom
docs/correct_native_virtual_doc
Sep 12, 2025
Merged

docs: correct dynamic call to writeModule example#11650
chenjiahan merged 4 commits intomainfrom
docs/correct_native_virtual_doc

Conversation

@stormslowly
Copy link
Contributor

Summary

Built in VirtualModulesPlugin's writeModule API can't be invoked to early.

close #11599

Related links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings September 12, 2025 06:41
@netlify
Copy link

netlify bot commented Sep 12, 2025

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit a0879ba
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/68c3cf4eebcc200008cf76ce
😎 Deploy Preview https://deploy-preview-11650--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added release: document release: document related release(mr only) team The issue/pr is created by the member of Rspack. labels Sep 12, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR corrects the documentation for the VirtualModulesPlugin's writeModule API by updating the example to use the correct compiler hook and adding a note explaining the timing restrictions.

  • Updated the dynamic module creation example to use thisCompilation hook instead of beforeCompile
  • Added explanatory note about when writeModule can be safely called
  • Applied the same changes to both English and Chinese documentation

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
website/docs/zh/plugins/rspack/virtual-modules-plugin.mdx Updated Chinese documentation with correct hook usage and timing explanation
website/docs/en/plugins/rspack/virtual-modules-plugin.mdx Updated English documentation with correct hook usage and timing explanation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@stormslowly stormslowly changed the title docs: correct dynamic call to writeModule exampel. docs: correct dynamic call to writeModule example Sep 12, 2025
@stormslowly
Copy link
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Breezy!

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

@chenjiahan chenjiahan enabled auto-merge (squash) September 12, 2025 07:44
@chenjiahan chenjiahan merged commit aca5268 into main Sep 12, 2025
25 checks passed
@chenjiahan chenjiahan deleted the docs/correct_native_virtual_doc branch September 12, 2025 07:45
@chenjiahan
Copy link
Member

LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: document release: document related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: VirtualModulesPlugin writeModule example seems wrong.

3 participants