Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
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.
Is this related to PATH or something else?
There was a problem hiding this comment.
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.