Skip to content

Comments

feat!: remove experiments.outputModule config#12912

Merged
JSerFeng merged 3 commits intomainfrom
refactor/remove-experiments-outputModule
Feb 3, 2026
Merged

feat!: remove experiments.outputModule config#12912
JSerFeng merged 3 commits intomainfrom
refactor/remove-experiments-outputModule

Conversation

@JSerFeng
Copy link
Contributor

@JSerFeng JSerFeng commented Feb 2, 2026

Summary

Remove experimental.outputModule.

Now you only need to set output.module to true if you want esm for app.

If you are building a library, when seting library.type to 'module' | 'modern-module', output.module, Rspack will set output.module to true automatically

export default {
  output: {
    module: true
  }
}

Related links

Checklist

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

Copilot AI review requested due to automatic review settings February 2, 2026 10:16
@github-actions github-actions bot added release: refactor team The issue/pr is created by the member of Rspack. labels Feb 2, 2026
@JSerFeng JSerFeng requested review from chenjiahan and removed request for LingyuCoder, Copilot, h-a-n-a and hardfist February 2, 2026 10:16
@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2026

Rsdoctor Bundle Diff Analysis

Found 5 projects in monorepo, 5 projects with changes.

📊 Quick Summary
Project Total Size Change
react-10k 5.7 MB +11.0 B (0.0%)
react-1k 825.4 KB +11.0 B (0.0%)
react-5k 2.7 MB +11.0 B (0.0%)
rome 984.2 KB +8.0 B (0.0%)
ui-components 2.2 MB +67.0 B (0.0%)
📋 Detailed Reports (Click to expand)

📁 react-10k

Path: ../build-tools-performance/cases/react-10k/dist/rsdoctor-data.json

📌 Baseline Commit: 758f6227be | PR: #12782

Metric Current Baseline Change
📊 Total Size 5.7 MB 5.7 MB +11.0 B (0.0%)
📄 JavaScript 5.7 MB 5.7 MB +11.0 B (0.0%)
🎨 CSS 21.0 B 21.0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: react-10k Bundle Diff

📁 react-1k

Path: ../build-tools-performance/cases/react-1k/dist/rsdoctor-data.json

📌 Baseline Commit: 758f6227be | PR: #12782

Metric Current Baseline Change
📊 Total Size 825.4 KB 825.4 KB +11.0 B (0.0%)
📄 JavaScript 825.4 KB 825.4 KB +11.0 B (0.0%)
🎨 CSS 0 B 0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: react-1k Bundle Diff

📁 react-5k

Path: ../build-tools-performance/cases/react-5k/dist/rsdoctor-data.json

📌 Baseline Commit: 758f6227be | PR: #12782

Metric Current Baseline Change
📊 Total Size 2.7 MB 2.7 MB +11.0 B (0.0%)
📄 JavaScript 2.7 MB 2.7 MB +11.0 B (0.0%)
🎨 CSS 21.0 B 21.0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: react-5k Bundle Diff

📁 rome

Path: ../build-tools-performance/cases/rome/dist/rsdoctor-data.json

📌 Baseline Commit: 758f6227be | PR: #12782

Metric Current Baseline Change
📊 Total Size 984.2 KB 984.2 KB +8.0 B (0.0%)
📄 JavaScript 984.2 KB 984.2 KB +8.0 B (0.0%)
🎨 CSS 0 B 0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: rome Bundle Diff

📁 ui-components

Path: ../build-tools-performance/cases/ui-components/dist/rsdoctor-data.json

📌 Baseline Commit: 758f6227be | PR: #12782

Metric Current Baseline Change
📊 Total Size 2.2 MB 2.2 MB +67.0 B (0.0%)
📄 JavaScript 2.0 MB 2.0 MB +67.0 B (0.0%)
🎨 CSS 267.8 KB 267.8 KB 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: ui-components Bundle Diff

Generated by Rsdoctor GitHub Action

@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2026

📦 Binary Size-limit

Comparing 2747fab to chore: gracefully explain unsupported interfaces (#12782) by Martin Jesper Low Madsen

🙈 Size remains the same at 48.33MB

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 2, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing refactor/remove-experiments-outputModule (2747fab) with main (758f622)

Summary

✅ 16 untouched benchmarks
⏩ 1 skipped benchmark1

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports.

Copilot AI review requested due to automatic review settings February 3, 2026 06:03
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 3, 2026

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 pull request refactors the configuration for ESM module output by removing the experimental experiments.outputModule flag and promoting output.module as the standard configuration option.

Changes:

  • Removed experiments.outputModule from type definitions, normalization logic, and default configuration
  • Updated all test configurations to use output.module instead of experiments.outputModule
  • Modified defaults logic to automatically set output.module to true when library.type is 'module' or 'modern-module'
  • Updated documentation in both English and Chinese to reflect the new configuration approach

Reviewed changes

Copilot reviewed 161 out of 161 changed files in this pull request and generated 17 comments.

Show a summary per file
File Description
website/docs/zh/guide/features/esm.mdx Removed outdated reference to experiments.outputModule in Chinese documentation
website/docs/zh/config/output.mdx Updated Chinese documentation but contains outdated code examples
website/docs/zh/config/externals.mdx Updated Chinese documentation to reference output.module
website/docs/zh/config/experiments.mdx Removed experiments.outputModule section from Chinese documentation
website/docs/en/guide/features/esm.mdx Removed outdated reference to experiments.outputModule
website/docs/en/config/output.mdx Updated to remove experimental flag requirement and added automatic behavior description
website/docs/en/config/externals.mdx Updated to reference output.module instead of experiments.outputModule
website/docs/en/config/experiments.mdx Removed experiments.outputModule section
tests/rspack-test/**/*.js Migrated 100+ test configurations from experiments.outputModule to output.module, with some containing duplicates
packages/rspack/src/config/types.ts Removed outputModule from Experiments type definition
packages/rspack/src/config/normalization.ts Removed outputModule from ExperimentsNormalized interface
packages/rspack/src/config/defaults.ts Refactored to set output.module based on library types, but has ordering issue
packages/rspack/etc/core.api.md Updated API documentation to remove experiments.outputModule
packages/rspack-test-tools/src/case/*.ts Updated test tooling to use output.module
crates/rspack/src/builder/mod.rs Removed outputModule from Rust builder implementation
Comments suppressed due to low confidence (1)

website/docs/zh/config/output.mdx:1577

  • The code example still includes the removed experiments.outputModule configuration. This should be removed to match the English documentation and align with the PR's refactoring. The example should only show output.module: true without any experimental flags.

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

chenjiahan
chenjiahan previously approved these changes Feb 3, 2026
Copy link
Member

@chenjiahan chenjiahan left a comment

Choose a reason for hiding this comment

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

👍

@chenjiahan chenjiahan changed the title refactor: remove experiments.outputModule feat!: remove experiments.outputModule config Feb 3, 2026
@github-actions github-actions bot added release: feature release: feature related release(mr only) and removed release: refactor labels Feb 3, 2026
@JSerFeng JSerFeng enabled auto-merge (squash) February 3, 2026 06:24
@JSerFeng JSerFeng force-pushed the refactor/remove-experiments-outputModule branch from f23d3fb to 2747fab Compare February 3, 2026 07:06
@JSerFeng JSerFeng merged commit f3ddd72 into main Feb 3, 2026
97 of 104 checks passed
@JSerFeng JSerFeng deleted the refactor/remove-experiments-outputModule branch February 3, 2026 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: feature release: feature 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.

3 participants