CSS sass --watch 自动缩小?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8980398/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
sass --watch with automatic minify?
提问by tester
Is there a way to run:
有没有办法运行:
sass --watch a.scss:a.css
sass --watch a.scss:a.css
but have a.cssend up being minified?
但a.css最终被缩小了?
How would I avoid having to run a separate minification step as I compile my stylesheet?
我如何避免在编译样式表时运行单独的缩小步骤?
回答by tester
sass --watch a.scss:a.css --style compressed
Consult the documentation for updates:
请参阅文档以获取更新:
回答by Madan Sapkota
If you are using JetBrainseditors like IntelliJ IDEA, PhpStorm, WebStormetc. Use the following settings in Settings > File Watchers.

如果您使用IntelliJ IDEA、PhpStorm、WebStorm等JetBrains编辑器,请在设置 > 文件观察器中使用以下设置。

Convert
style.scsstostyle.cssset the arguments--no-cache --update $FileName$:$FileNameWithoutExtension$.cssand output paths to refresh
$FileNameWithoutExtension$.cssConvert
style.scssto compressedstyle.min.cssset the arguments--no-cache --update $FileName$:$FileNameWithoutExtension$.min.css --style compressedand output paths to refresh
$FileNameWithoutExtension$.min.css
转换
style.scss以style.css设置参数--no-cache --update $FileName$:$FileNameWithoutExtension$.css和输出路径刷新
$FileNameWithoutExtension$.css转换
style.scss为压缩style.min.css集参数--no-cache --update $FileName$:$FileNameWithoutExtension$.min.css --style compressed和输出路径刷新
$FileNameWithoutExtension$.min.css
回答by Olivier Loynet
If you're using compass:
如果您使用指南针:
compass watch --output-style compressed

