dartsass: Import CSS without extension at compile time

Applicable to Dart Sass only:

- Sass imports with the .css extension indicate a plain CSS @import.
- Sass imports without the .css extension are imported at compile time.

Fixes #10592
This commit is contained in:
Joe Mooring
2023-02-23 16:23:36 -08:00
committed by Bjørn Erik Pedersen
parent 271318ad78
commit 2662faf61f
2 changed files with 67 additions and 6 deletions

View File

@@ -163,9 +163,9 @@ func (t importResolver) CanonicalizeURL(url string) (string, error) {
if strings.Contains(name, ".") {
namePatterns = []string{"_%s", "%s"}
} else if strings.HasPrefix(name, "_") {
namePatterns = []string{"_%s.scss", "_%s.sass"}
namePatterns = []string{"_%s.scss", "_%s.sass", "_%s.css"}
} else {
namePatterns = []string{"_%s.scss", "%s.scss", "_%s.sass", "%s.sass"}
namePatterns = []string{"_%s.scss", "%s.scss", "_%s.sass", "%s.sass", "_%s.css", "%s.css"}
}
name = strings.TrimPrefix(name, "_")