godartsass
godartsass copied to clipboard
sassTranspiler.Execute returns "Unexpected EOF" for indented sass.
The following returns Unexpected EOF no matter the indented sass input. Is this a bug, or am I going about this incorrectly?
import (
"log"
"os"
"github.com/bep/godartsass/v2"
)
func Compile() {
sassTranspiler, err := godartsass.Start(godartsass.Options{})
if err != nil {
log.Fatal(err)
}
defer sassTranspiler.Close()
result, err := sassTranspiler.Execute(godartsass.Args{
Source: "./_index.sass",
OutputStyle: godartsass.OutputStyleCompressed,
SourceSyntax: godartsass.SourceSyntaxSASS,
EnableSourceMap: true,
})
if err != nil {
log.Fatal(err)
}
os.WriteFile("../assets/style.css", []byte(result.CSS), 0644)
os.WriteFile("../assets/style.css.map", []byte(result.SourceMap), 0644)
}
Copilot told me to scrap it and use exec.Command("sass" ...)