Skip to content

docs(externals): add modern-module externals example#13979

Merged
JSerFeng merged 1 commit into
web-infra-dev:mainfrom
JSerFeng:fy/modern-module-externals-doc-example
May 11, 2026
Merged

docs(externals): add modern-module externals example#13979
JSerFeng merged 1 commit into
web-infra-dev:mainfrom
JSerFeng:fy/modern-module-externals-doc-example

Conversation

@JSerFeng

Copy link
Copy Markdown
Contributor

Summary

  • add an explicit externalsType: 'modern-module' example in the EN/ZH externals docs
  • show how static ESM import, dynamic import(), and CommonJS require() externals render in modern-module output
  • keep the example aligned with the current compatibility behavior where modern-module externals must be opted in explicitly

Checks

  • pnpm exec prettier --check website/docs/en/config/externals.mdx website/docs/zh/config/externals.mdx
  • pre-commit pnpm --dir website run check:spell via Node v22.21.1

@github-actions github-actions Bot added the release: document release: document related release(mr only) label May 11, 2026
@JSerFeng JSerFeng marked this pull request as ready for review May 11, 2026 03:41
Copilot AI review requested due to automatic review settings May 11, 2026 03:41
@JSerFeng JSerFeng merged commit 071b8b3 into web-infra-dev:main May 11, 2026
25 checks passed

Copilot AI 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.

Pull request overview

This PR updates the externals configuration documentation to include an explicit externalsType: 'modern-module' example (in both EN and ZH), clarifying how externals are rendered when building output.library.type: 'modern-module' libraries and reinforcing the current requirement to opt in explicitly for compatibility.

Changes:

  • Add a modern-module externals example to the English externals docs, covering static import, dynamic import(), and CommonJS require() rendering.
  • Add the corresponding modern-module externals example to the Chinese externals docs with equivalent explanations and output illustration.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
website/docs/en/config/externals.mdx Adds a concrete externalsType: 'modern-module' example and shows expected ESM output behavior for import styles.
website/docs/zh/config/externals.mdx Mirrors the English update with a Chinese example and explanation of the same rendering behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants