fix(core): posix paths, diamond imports, comment safety#923
Merged
Conversation
…t safety
Fixes from review #4306329284 on hf#922:
- Normalize path.relative() output with .split(sep).join("/") so
rebased url() paths use forward slashes on Windows, matching the
posix-path convention in rewriteSubCompPaths.ts.
- Return empty string (not the original @import statement) when the
visited set detects a diamond import. Previously the stale @import
leaked through and caused a 404 after bundling.
- Strip CSS block comments before @import matching so commented-out
imports (/* @import url(...) */) are not resolved. Comments are
restored after processing via placeholder substitution.
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.
Summary
Follow-up to #922 addressing review feedback (#4306329284):
path.relative()emits\on Windows. Normalized output with.split(sep).join("/")to match the posix-path convention established inrewriteSubCompPaths.ts:15-19.@importstatement, which would have caused a 404 after bundling.@importmatching so/* @import url(...) */is preserved as-is, not resolved.Re: dist/ deletion
The
packages/producer/dist/deletion in #922 was a separate cleanup — those files were force-committed despite the root.gitignorealready havingdist/. No other package had dist tracked. The.gitignorealready covers it, no additional entry needed.Re: sub-composition @import gap
Sub-composition
<style>blocks not getting@importresolution is a pre-existing gap. Filed as a follow-up.Test plan
windows-latestCI job should now pass —url()paths use/regardless of platform