fix(build): normalize Windows path separators in rollup external check - #423
Open
andreas-karlsson wants to merge 1 commit into
Open
fix(build): normalize Windows path separators in rollup external check#423andreas-karlsson wants to merge 1 commit into
andreas-karlsson wants to merge 1 commit into
Conversation
`relative()` returns backslash-separated paths on Windows, so the `path.startsWith(prefix)` checks in `createExternalTest` never matched and local `build/` imports were misreported as unbundleable external deps. Co-authored-by: vihaan-vijay <mavijay898@gmail.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
andreas-karlsson
requested review from
AHB,
Billlynch,
fabriziodemaria,
mfranberg,
nicklasl,
sam-cook and
vahidlazio
as code owners
July 31, 2026 10:42
|
Thanks @andreas-karlsson! I appreciate you extracting this fix and keeping the co-authorship credit. I tested yarn bundle locally on Windows and can confirm it builds cleanly without path errors now! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split out from #419, which is otherwise closed — this is the one change from it worth landing.
normalizePath()returns the result ofrelative()verbatim. On Windows that is backslash-separated, so thepath.startsWith(prefix)checks increateExternalTest(whereprefixisbuild/) never match, and localbuild/imports get misreported as unbundleable external dependencies:Normalizing to forward slashes makes the prefix checks work on both platforms. No behavior change on POSIX, where
relative()already returns forward slashes.Credit to @vihaan-vijay, who found this while working on #419; retained as co-author on the commit.
Verification
yarn bundlepasses locally (macOS). The Windows path is not exercised by CI — this is a fix for local development on Windows.🤖 Generated with Claude Code