diff options
author | Bjørn Erik Pedersen <[email protected]> | 2024-02-20 14:46:03 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2024-02-20 17:00:32 +0100 |
commit | 621194a3197d27e3b5909bca9b3efa6ae70da86c (patch) | |
tree | 9dbdeac8dae393df7b63351a63bc166cc19ddecb /resources | |
parent | 48eec2a4e63cb0b542858f3b133eba19aa23978c (diff) | |
download | hugo-621194a3197d27e3b5909bca9b3efa6ae70da86c.tar.gz hugo-621194a3197d27e3b5909bca9b3efa6ae70da86c.zip |
Fix dart sass import regression
Fixes #12072
Diffstat (limited to 'resources')
-rw-r--r-- | resources/resource_transformers/js/options.go | 2 | ||||
-rw-r--r-- | resources/resource_transformers/tocss/dartsass/transform.go | 3 | ||||
-rw-r--r-- | resources/resource_transformers/tocss/scss/tocss.go | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/resources/resource_transformers/js/options.go b/resources/resource_transformers/js/options.go index df32e7012..1c29ad67c 100644 --- a/resources/resource_transformers/js/options.go +++ b/resources/resource_transformers/js/options.go @@ -218,7 +218,7 @@ func createBuildPlugins(depsManager identity.Manager, c *Client, opts Options) ( isStdin := args.Importer == stdinImporter var relDir string if !isStdin { - rel, found := fs.MakePathRelative(args.Importer) + rel, found := fs.MakePathRelative(args.Importer, true) if !found { // Not in any of the /assets folders. // This is an import from a node_modules, let diff --git a/resources/resource_transformers/tocss/dartsass/transform.go b/resources/resource_transformers/tocss/dartsass/transform.go index 73eca6a53..a9600f380 100644 --- a/resources/resource_transformers/tocss/dartsass/transform.go +++ b/resources/resource_transformers/tocss/dartsass/transform.go @@ -138,12 +138,13 @@ func (t importResolver) CanonicalizeURL(url string) (string, error) { if url == sass.HugoVarsNamespace { return url, nil } + filePath, isURL := paths.UrlToFilename(url) var prevDir string var pathDir string if isURL { var found bool - prevDir, found = t.c.sfs.MakePathRelative(filepath.Dir(filePath)) + prevDir, found = t.c.sfs.MakePathRelative(filepath.Dir(filePath), false) if !found { // Not a member of this filesystem, let Dart Sass handle it. diff --git a/resources/resource_transformers/tocss/scss/tocss.go b/resources/resource_transformers/tocss/scss/tocss.go index a4c4e6d8e..a3f2a5289 100644 --- a/resources/resource_transformers/tocss/scss/tocss.go +++ b/resources/resource_transformers/tocss/scss/tocss.go @@ -86,7 +86,7 @@ func (t *toCSSTransformation) Transform(ctx *resources.ResourceTransformationCtx if prev == "stdin" { prevDir = baseDir } else { - prevDir, _ = t.c.sfs.MakePathRelative(filepath.Dir(prev)) + prevDir, _ = t.c.sfs.MakePathRelative(filepath.Dir(prev), false) if prevDir == "" { // Not a member of this filesystem. Let LibSASS handle it. |