dartsass: Add silenceDeprecations option

Fixes #13045
This commit is contained in:
Bjørn Erik Pedersen
2024-11-18 10:04:37 +01:00
parent 1fd845eee4
commit 3b6eaf9b1f
7 changed files with 57 additions and 2 deletions

View File

@@ -74,8 +74,10 @@ func New(fs *filesystems.SourceFilesystem, rs *resources.Spec) (*Client, error)
case godartsass.LogEventTypeDebug:
// Log as Info for now, we may adjust this if it gets too chatty.
infol.Log(logg.String(message))
case godartsass.LogEventTypeDeprecated:
warnl.Logf("DEPRECATED [%s]: %s", event.DeprecationType, message)
default:
// The rest are either deprecations or @warn statements.
// The rest are @warn statements.
warnl.Log(logg.String(message))
}
},
@@ -151,6 +153,11 @@ type Options struct {
// @use "hugo:vars";
// $color: vars.$color;
Vars map[string]any
// Deprecations IDs in this slice will be silenced.
// The IDs can be found in the Dart Sass log output, e.g. "import" in
// WARN Dart Sass: DEPRECATED [import].
SilenceDeprecations []string
}
func decodeOptions(m map[string]any) (opts Options, err error) {