Sass——手表自动缩小?

有没有办法跑:

sass --watch a.scss:a.css

但是a.css最终被最小化了吗?

如何避免在编译样式表时运行单独的缩小步骤?

169733 次浏览
sass --watch a.scss:a.css --style compressed

请查阅文档以获得更新:

如果你使用指南针:

compass watch --output-style compressed
如果你正在使用JetBrains编辑器,如IntelliJ IDEAPhpStormWebStorm等。在“设置>文件监视器”中使用以下设置。 enter image description here < / p >
  1. Convert style.scss to style.css设置参数

    --no-cache --update $FileName$:$FileNameWithoutExtension$.css
    

    和要刷新的输出路径

    $FileNameWithoutExtension$.css
    
  2. Convert style.scss to compressed style.min.css set the arguments

    --no-cache --update $FileName$:$FileNameWithoutExtension$.min.css --style compressed
    

    和要刷新的输出路径

    $FileNameWithoutExtension$.min.css
    

有很多不同的方法

sass --watch --style=compressed main.scss main.css

sass --watch a.scss:a.css --style compressed

通过使用visual studio代码扩展实时sass编译器

see more

这招对我很管用:

sass --watch --style=compressed a.scss:a.css

参考