Add Dart Sass support

But note that the Dart Sass Embedded Protocol is still in beta (beta 5), a main release scheduled for Q1 2021.

Fixes #7380
Fixes #8102
This commit is contained in:
Bjørn Erik Pedersen 2020-12-23 09:26:23 +01:00
parent f9f779786e
commit cea1574023
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
26 changed files with 804 additions and 207 deletions

View file

@ -411,6 +411,9 @@ func (r *resourceAdapter) transform(publish, setContent bool) error {
errMsg = ". Check your PostCSS installation; install with \"npm install postcss-cli\". See https://gohugo.io/hugo-pipes/postcss/"
} else if tr.Key().Name == "tocss" {
errMsg = ". Check your Hugo installation; you need the extended version to build SCSS/SASS."
} else if tr.Key().Name == "tocss-dart" {
errMsg = ". You need dart-sass-embedded in your system $PATH."
} else if tr.Key().Name == "babel" {
errMsg = ". You need to install Babel, see https://gohugo.io/hugo-pipes/babel/"
}
@ -442,6 +445,9 @@ func (r *resourceAdapter) transform(publish, setContent bool) error {
if tryFileCache {
f := r.target.tryTransformedFileCache(key, updates)
if f == nil {
if err != nil {
return newErr(err)
}
return newErr(errors.Errorf("resource %q not found in file cache", key))
}
transformedContentr = f