I’m trying to run postcss and tree-shake the css with the following code:
{{ $fontawesome := resources.Get "css/fontawesome/fontawesome.css" }}
{{ $brands := resources.Get "css/fontawesome/brands.css" }}
{{ $regular := resources.Get "css/fontawesome/regular.css" }}
{{ $solid := resources.Get "css/fontawesome/solid.css" }}
{{- $bootstrap := resources.Get "css/bootstrap.min.css" -}}
{{- $nowUi := resources.Get "scss/now-ui-kit.scss" | resources.ToCSS (dict "enableSourceMap" false "outputStyle" "compressed") -}}
{{- $style := slice $bootstrap $nowUi $montserrat $fontawesome $brands $regular $solid | resources.Concat "css/style.css" | resources.Fingerprint -}}
{{ $styles := $style | postCSS (dict "config" "./assets/css/postcss.config.js") | minify -}}
{{ with ($styles ) }}
<style>
{{.Content | safeCSS }}
</style>
{{ end }}
It works locally, but on my server running ubuntu it fails with:
error calling Content: POSTCSS: failed to transform "css/style.276ea63b605d92be12e51bfd84d36777a9c864933d025be61fe3570cbebbe2bb.css"
I double checked that all the modules were installed and even tried sudo npm i -g
. The error isn’t all that descriptive to me. Can anyone point me in the right direction?