我正在尝试使用SASS,想要创建一个style.css文件,并将该文件压缩为style.min.css。
sass --watch sass/style:css --style compressed
这很好,但我需要自动化编译和压缩的过程。
我在其他stackoverflow中找到了这段代码:
sass --watch sass/style.scss:css/style.css --watch css/style.css:css/style.min.css --style compressed --scss
但现在它不按我想要的方式工作了。此外,2020年Sass网页上的代码已经不同了。
https://sass-lang.com/documentation/cli/dart-sass#style
我不使用gulp工具,因为我认为这对于WordPress项目来说并不必要。
有人可以帮助我吗?
node-sass
比sass
更快。 使用非常简单:node-sass ./style.scss ./style.min.css -w --output-style compressed
。 - Grzegorz T.