-
Notifications
You must be signed in to change notification settings - Fork 24
fix(win): include drive letter #364
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
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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 fixes a Windows-specific issue where drive letters were not being included in file paths, causing duplicate imports in the bundling process. The fix switches from POSIX-specific path handling to cross-platform path resolution and properly escapes backslashes for JavaScript string compatibility.
- Switches from
node:path/posixtonode:pathfor cross-platform compatibility - Simplifies ROOT path calculation to use actual filesystem paths instead of POSIX-normalized paths
- Adds backslash escaping for Windows paths in JavaScript import strings
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/generators/web/utils/generate.mjs | Updates path import and adds backslash escaping for CSS import |
| src/generators/web/constants.mjs | Simplifies ROOT calculation and adds backslash escaping for all JSX component imports |
|
@nodejs/web-infra Fast-tracking, bug fix |
| ) => { | ||
| // '\' characters shouldn't escape the next character, | ||
| // but rather be treated as slashes. | ||
| source = source.replaceAll('\\', '\\\\'); |
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.
Is this related to PATH or something else?
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.
Backslashes (Windows paths), when evaluated via Function, escape the next character, so we need to escape them.
Closes #363
Ref: rolldown/rolldown#5364 (comment)
If we include the drive letters, the resolution will not duplicate imports.