-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resources.ToCSS produces "stdin" in sourcemap sources if no "@include" is present in SCSS file #8174
Comments
toothrot
added a commit
to toothrot/hugo
that referenced
this issue
Sep 5, 2022
Simple sites may only have one css file. Update the replace directive to correctly match single-file sourcemaps and multi-file sourcemaps. Fixes gohugoio#8174
toothrot
added a commit
to toothrot/hugo
that referenced
this issue
Sep 5, 2022
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 gohugoio#8174
toothrot
added a commit
to toothrot/hugo
that referenced
this issue
Sep 5, 2022
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 gohugoio#8174
bep
pushed a commit
that referenced
this issue
Sep 6, 2022
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 issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
yes
Bug Description
When using Hugo pipe for SASS/SCSS with option
"enableSourceMap" true
in a theme's template the resulting sourcemap shows the following behavior:style.scss
without@import
style.css.map
style.scss
with@import
pointing to an empty filestyle.css.map
The resulting source map contains the expected value if the
sources
array contains more than one item, otherwise it simply containsstdin
. This makes debugging CSS via browser tooling very hard, especially when using more than one SCSS style sheet on the same page.The respective Hugo pipe was called like this in
themes/my-hugo-theme/layout/_default/baseof.html
:I believe the issue is caused by this piece of code in the Hugo sources: resources/resource_transformers/tocss/scss/tocss.go line 156
To me it looks like it expects to find
stdin",
, but this is not the case for a SCSS file without an@import
, because there is simply no,
after the"stdin"
in this case (there is only one item in the array and a trailing comma is not needed).The text was updated successfully, but these errors were encountered: