mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
scss: Handle single-file sourcemaps correctly
Simple sites may only have one css file. Update the replace directive to correctly match single-file sourcemaps and multi-file sourcemaps. Verified locally with and without SASS and CSS imports. Fixes #8174
This commit is contained in:
parent
06c3ac6741
commit
02c89a446d
1 changed files with 1 additions and 1 deletions
|
@ -163,7 +163,7 @@ func (t *toCSSTransformation) Transform(ctx *resources.ResourceTransformationCtx
|
||||||
// This is a workaround for what looks like a bug in Libsass. But
|
// This is a workaround for what looks like a bug in Libsass. But
|
||||||
// getting this resolution correct in tools like Chrome Workspaces
|
// getting this resolution correct in tools like Chrome Workspaces
|
||||||
// is important enough to go this extra mile.
|
// is important enough to go this extra mile.
|
||||||
mapContent := strings.Replace(res.SourceMapContent, `stdin",`, fmt.Sprintf("%s\",", sourcePath), 1)
|
mapContent := strings.Replace(res.SourceMapContent, `stdin"`, fmt.Sprintf("%s\"", sourcePath), 1)
|
||||||
|
|
||||||
return ctx.PublishSourceMap(mapContent)
|
return ctx.PublishSourceMap(mapContent)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue