-
-
Notifications
You must be signed in to change notification settings - Fork 200
fix(cli/eject): fix the component path not right #2896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for rspress-v2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Rsdoctor Bundle Diff Analysis📁 webPath:
📦 Download Diff Report: web Bundle Diff Generated by Rsdoctor GitHub Action |
There was a problem hiding this 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 adds sideEffects configuration for webpack optimization and fixes a bug in the eject functionality where theme components could not be found due to incorrect path resolution in ESM modules.
Key Changes
- Fixed eject functionality by using a constant for the ejected theme path instead of computing it with
__dirname(which doesn't work correctly in ESM) - Added
sideEffects: falseconfiguration for the theme index to enable better tree-shaking - Added path resolution logic for relative theme directories
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/core/src/node/constants.ts | Added EJECTED_THEME constant pointing to the dist/eject-theme directory |
| packages/core/src/node/eject.ts | Fixed eject functionality by using the new EJECTED_THEME constant instead of computing path with __dirname |
| packages/core/src/node/initRsbuild.ts | Added path resolution for relative theme directories, renamed CSS virtual module rule for clarity, and added sideEffects configuration for theme optimization |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cb430ee to
3edd895
Compare
Summary
chore: add sideEffects and fix the eject not work
Related Issue
Checklist