dartsass: Add sourceMapIncludeSources option

This commit is contained in:
Bjørn Erik Pedersen
2022-12-02 09:26:38 +01:00
parent 7d16c3c0c1
commit e93138dfdb
4 changed files with 25 additions and 17 deletions

View File

@@ -127,6 +127,9 @@ type Options struct {
// When enabled, Hugo will generate a source map.
EnableSourceMap bool
// If enabled, sources will be embedded in the generated source map.
SourceMapIncludeSources bool
}
func decodeOptions(m map[string]any) (opts Options, err error) {

View File

@@ -85,8 +85,9 @@ func (t *transform) Transform(ctx *resources.ResourceTransformationCtx) error {
baseDir: baseDir,
c: t.c,
},
OutputStyle: godartsass.ParseOutputStyle(opts.OutputStyle),
EnableSourceMap: opts.EnableSourceMap,
OutputStyle: godartsass.ParseOutputStyle(opts.OutputStyle),
EnableSourceMap: opts.EnableSourceMap,
SourceMapIncludeSources: opts.SourceMapIncludeSources,
}
// Append any workDir relative include paths