Skip to content

Conversation

@Timeless0911
Copy link
Contributor

@Timeless0911 Timeless0911 commented Jan 19, 2026

Summary

Fixes @rspack/browser failure after pure ESM transformation.

  • Renamed rslib.browser.config.mts to rslib.browser.config.ts
  • Add a plugin to remove createRequire usages from the code, since createRequire is not available in browser environment.
  • Updated packages/rspack-browser/package.json exports to use ./dist/index.js.
  • Added explicit extensions to imports in browser E2E tests.

Related links

Checklist

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

@netlify
Copy link

netlify bot commented Jan 19, 2026

Deploy Preview for rspack-v2 canceled.

Name Link
🔨 Latest commit 9f89b39
🔍 Latest deploy log https://app.netlify.com/projects/rspack-v2/deploys/696e00de29aa0d00084c6e77

@github-actions github-actions bot added team The issue/pr is created by the member of Rspack. release: bug fix release: bug related release(mr only) labels Jan 19, 2026
@Timeless0911 Timeless0911 changed the title fix(browser): fix @rspack/browser failure after pure esm transformation fix(browser): fix @rspack/browser failure after pure esm transformation Jan 19, 2026
@github-actions
Copy link
Contributor

Rsdoctor Bundle Diff Analysis

Found 5 projects in monorepo, 5 projects with changes.

📊 Quick Summary
Project Total Size Change
react-10k 5.7 MB -37.0 B (-0.0%)
react-1k 825.3 KB -29.0 B (-0.0%)
react-5k 2.7 MB -28.0 B (-0.0%)
ui-components 2.1 MB -30.0 B (-0.0%)
rome 985.8 KB +1.7 KB (0.2%)
📋 Detailed Reports (Click to expand)

📁 react-10k

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

📌 Baseline Commit: 6991b7b596 | PR: #12778

Metric Current Baseline Change
📊 Total Size 5.7 MB 5.7 MB -37.0 B (-0.0%)
📄 JavaScript 5.7 MB 5.7 MB -37.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: 6991b7b596 | PR: #12778

Metric Current Baseline Change
📊 Total Size 825.3 KB 825.4 KB -29.0 B (-0.0%)
📄 JavaScript 825.3 KB 825.4 KB -29.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: 6991b7b596 | PR: #12778

Metric Current Baseline Change
📊 Total Size 2.7 MB 2.7 MB -28.0 B (-0.0%)
📄 JavaScript 2.7 MB 2.7 MB -28.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

📁 ui-components

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

📌 Baseline Commit: 6991b7b596 | PR: #12778

Metric Current Baseline Change
📊 Total Size 2.1 MB 2.1 MB -30.0 B (-0.0%)
📄 JavaScript 2.0 MB 2.0 MB -30.0 B (-0.0%)
🎨 CSS 83.0 KB 83.0 KB 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: ui-components Bundle Diff

📁 rome

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

📌 Baseline Commit: 6991b7b596 | PR: #12778

Metric Current Baseline Change
📊 Total Size 985.8 KB 984.2 KB +1.7 KB (0.2%)
📄 JavaScript 985.8 KB 984.2 KB +1.7 KB (0.2%)
🎨 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

Generated by Rsdoctor GitHub Action

@github-actions
Copy link
Contributor

📦 Binary Size-limit

Comparing 9f89b39 to fix: sort css by sourceorder, esm import comes first (#12778) by Fy

🎉 Size decreased by 322.13KB from 47.99MB to 47.68MB (⬇️0.66%)

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 19, 2026

Merging this PR will not alter performance

✅ 16 untouched benchmarks
⏩ 1 skipped benchmark1


Comparing fix/rspack-browser-esm (9f89b39) with v2 (f81f16e)

Open in CodSpeed

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.

@Timeless0911 Timeless0911 enabled auto-merge (squash) January 19, 2026 10:46
@Timeless0911 Timeless0911 merged commit d28ee8d into v2 Jan 19, 2026
53 checks passed
@Timeless0911 Timeless0911 deleted the fix/rspack-browser-esm branch January 19, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: bug fix release: bug 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