[heft-sass-plugin] Fix resolution of plain .css files imported via @use / @import#5824
Open
bartvandenende-wm wants to merge 2 commits into
Open
[heft-sass-plugin] Fix resolution of plain .css files imported via @use / @import#5824bartvandenende-wm wants to merge 2 commits into
bartvandenende-wm wants to merge 2 commits into
Conversation
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
Fixes #5823
Since
@rushstack/heft-sass-pluginv0.17.0, a plain.cssfile referenced from another stylesheet via@use(or@import) could no longer be resolved, even though the file existed and dart-sass supports loading plain CSS. Builds failed withCan't find stylesheet to import.This restores the behavior from v0.16.0 and earlier.Details
The importer rewrite in #5140 took over all resolution, but its candidate logic only considered
.sass/.scss. A.cssURL therefore fell through and probed nonexistent paths liketokens.css.scss.This change makes the importer resolve
.cssthe same way dart-sass does:.cssextension now resolves to the literal file..css(and/index.css), in Sass'spreference order (
.scss→.sass→.css).How it was tested
Added unit tests covering
@useof a plain.cssfile both with an explicit extension and extensionless, asserting the import resolves and the CSS rules are inlined into the output. All existing tests continue to pass.