SASS / Compass可以将foo.scss编译为foo.min.css和foo.dbg.css吗? [英] Can SASS/Compass compile foo.scss to foo.min.css and foo.dbg.css?

查看:84
本文介绍了SASS / Compass可以将foo.scss编译为foo.min.css和foo.dbg.css吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将一组 .scss 文件编译为不同的文件名。

I want to compile a set of .scss files to different filenames.

在开发中,我想要编译例如 foo.scss foo.dbg.css (未最小化并带有注释)。在生产中,我想拥有例如。 foo.min.css (最小)。

In development, I want to compile eg. foo.scss to foo.dbg.css (unminified and with comments). In production, I want to have eg. foo.min.css (minified).

有没有办法告诉SASS / Compass用作什么目标扩展?命令行开关? config.rb 选项?

Is there a way to tell SASS/Compass what to use as the target extension? A command-line switch? A config.rb option?

编写先编译然后重命名文件的脚本似乎是一个糟糕的选择,因为那样我就不能有效地使用 compass手表

Writing a script that first compiles and then renames files seems like a bad option, because then I can't use compass watch efficiently.

(嗯,我可以编译到两个不同的输出目录,然后编写一个从那里复制文件的脚本。这有点笨拙。)

(Well, I could compile to two different output directories and then write a script that copies the files from there. That feels a bit clumsy.)

更新:我通过编写监视代码的简化版本来解决此问题。发生更改时,它会触发重新编译到两个不同的输出目录,然后重命名并将文件移动到位置。

UPDATE: I worked around the problem by writing a simplified version of the watch code. When something changes, it triggers a recompile to two different output directories, then renames and moves the files to place.

推荐答案

否不能。我在有关RTL样式表的邮件列表中问了同样的问题。
但是,您可以使用其他 config.rb文件运行指南针编译。
试试 compass compile -c debug.rb

No it can't. I asked the same question in the mailing lists about RTL stylesheets. However, you can run compass compile using different 'config.rb' files. Try compass compile -c debug.rb.

UPDATE :指南针仍然不能,但是Gulp可以使用Sass和Compass监视并生成多个目标CSS文件。参见 https://github.com/Snugug/gulp-css-target/

UPDATE: Compass still can't, but Gulp can watch and generate several target css files using Sass and Compass. See https://github.com/Snugug/gulp-css-target/

这篇关于SASS / Compass可以将foo.scss编译为foo.min.css和foo.dbg.css吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆