Firstly great news with Hugo Pipes and support for SASS.
I have downloaded the latest Windows extended version (hugo_extended_0.43_Windows-64bit.zip) of Hugo to test implementing SASS. If I run “hugo env” I see the following:
Hugo Static Site Generator v0.44-DEV/extended windows/amd64 BuildDate: unknown
GOOS=“windows”
GOARCH=“amd64”
GOVERSION=“go1.10.3”
However if I create a new site, add the ananke theme and create a scss file:
\themes\ananke\assets\scss\main.scss
I get the following serve error:
Building sites … ERROR 2018/07/10 12:18:21 error: failed to transform resource: failed to transform “scss/main.css” (text/css): this feature is not available in your current Hugo version
Am I doing something wrong? I thought the latest extended version had scss support.
Just noting for anyone who finds this issue in the future that it’s no longer required to install postcss-cli with the global flag (npm install -g postcss-cli); it can be installed locally to your project as of Hugo 0.45
Whereabouts? For example, I have an assets/scripts/ directory that has my package.json since I am still using Webpack 4 for AMD. Will Hugo find postcss-cli if I add this to my devDependencies at assets/scripts/package.json or are you installing postcss-cli at the root of the project, @budparr?
@budparr, Oops. I should have been clearer. I’m wondering if I install postcss-cli deeper inside the project rather than at the root (i.e. since my package.json and node_modules are at <project>/assets/scripts/package.json rather than <project>/package.json) if Hugo is smart enough to look for the local installation at multiple levels. I’m pretty familiar with the -D flag That said, I should probably just test this myself!
I think i have the same issue. With HUGO v0.46. Am i doing something wrong ?
$ hugo -w serve
Building sites … ERROR 2018/08/02 00:27:05 error: failed to transform resource: TOCSS: failed to transform "scss/orbit-6.scss" (text/x-scss): this feature is not available in your current Hugo version
Of course the file “themes/<my_theme>/assets/scss/” is available on path. I have a few imports in this file, is the problem with the path of these imports ? (if yes, maybe the error message is misleading).
Also, you need to remember that it is the same people who get notified about GitHub issues and posts in here, so double posting isn’t as effective as one would think.
Sorry for the double post. Here is the exact output of hugo version
Hugo Static Site Generator v0.46 windows/amd64 BuildDate: 2018-08-01T09:01:27Z
I tried to deploy on Netlify with the same version and it worked there!.
One interesting thing to note. If I have the resources pre-built by the global postcss-cli. hugo does not error. However it does not register any changes I make in the css after that either.
I’ve tested this on windows cmd and Hugo only detects PostCSS when installed globally. With Git Bash it does not detect neither the global or local install of PostCSS.
Edit: Git Bash DOES detect the global install of PostCSS too.