Skip to content

fix(browser): avoid use the conventional index entry point#853

Merged
fi3ework merged 1 commit intomainfrom
b1
Jan 9, 2026
Merged

fix(browser): avoid use the conventional index entry point#853
fi3ework merged 1 commit intomainfrom
b1

Conversation

@fi3ework
Copy link
Copy Markdown
Member

@fi3ework fi3ework commented Jan 9, 2026

Summary

  • Fix browser mode failing when project has src/index.ts (Rsbuild auto-detects it as default entry)
  • Use modifyEnvironmentConfig with order: 'post' to ensure rstest's entry config has highest priority
  • Directly overwrite source.entry after merge instead of relying on mergeEnvironmentConfig
  • Add e2e test case with src/index.ts in basic fixture to prevent regression

Related Links

Checklist

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

Copilot AI review requested due to automatic review settings January 9, 2026 08:15
@netlify
Copy link
Copy Markdown

netlify bot commented Jan 9, 2026

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit f0142d1
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/6960b9406a9a6e0008b19635
😎 Deploy Preview https://deploy-preview-853--rstest-dev.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.

Copy link
Copy Markdown
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 fixes a bug in browser mode where the presence of src/index.ts in a project causes Rsbuild to auto-detect it as the default entry point, interfering with rstest's browser test runner. The fix ensures rstest's entry configuration takes highest priority by using modifyEnvironmentConfig with order: 'post' and explicitly overwriting the entry after merging configurations.

Key changes:

  • Modified the plugin API call structure to use object form with handler and order: 'post'
  • Entry configuration now explicitly overwrites after merge to prevent Rsbuild auto-detection
  • Added regression test fixture with src/index.ts in the basic e2e test suite

Reviewed changes

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

File Description
packages/browser/src/hostController.ts Restructured modifyEnvironmentConfig call to use order: 'post' and explicitly overwrite entry config after merge to ensure rstest's entry has highest priority
e2e/browser-mode/fixtures/basic/src/index.ts Added test fixture file to verify the fix works when src/index.ts exists in project

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

@fi3ework fi3ework merged commit 2b21e7c into main Jan 9, 2026
32 of 33 checks passed
@fi3ework fi3ework deleted the b1 branch January 9, 2026 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants