Hi,
I’m creating an assets bundle. I have multiple folders with sass files (“components”, “forms”, “buttons” etc). I’m iterating through all those folders and adding files from each folder to “main.scss” file. Code below works but I would like to remove the need to Initialize $style variable with a resource.
{{ $style := resources.Get "scss/main.scss" }}
I would like to initialize $style as an empty array to which I later add all those files.
Something like this (it does not work)
{{ $style := [] }}
My current code:
{{ $style := resources.Get "scss/main.scss" }}
{{ $components := resources.Match "scss/**/*.scss" }}
{{ range $components }}
{{ $style = slice $style . | resources.Concat .Name }}
{{ end }}
{{ $style = slice $style | resources.Concat "main.scss" | toCSS | minify | fingerprint }}
<link rel="stylesheet" href="{{ $style.Permalink }}">