1

I've using SASS and generating a debug version of the style sheet for use with Firebug/FireSASS.

If I then try to minify my outputted .css file it includes all the SASS debug info. Is it possible to get SASS create both a debug version and a compressed version at the same time?

I current use:

scss --no-cache --update --debug-info file.sass:file.css

This output then gets pushed to YUI Compressor CSS which is minifying the debug code.

4

1 回答 1

2

没有办法用一个命令生成两组 SASS。

我建议您在开发期间只使用一个命令,在部署到生产期间使用另一个命令。

此外,SASS 完全能够自行最小化 CSS,因此使用 YUI Compressor 是多余的。

您还应该考虑使用Compass,它会给您带来很多好处(其中最有价值的是让您可以利用许多强大的 Compass 扩展)。Compass 允许您配置开发和生产环境:

# Add this to config.rb

# Invoke from command line: compass watch -e development --force
if environment == :development
  output_style = :expanded
  line_comments = true
  sass_options = { :debug_info => true }
else
  output_style = :compressed
end

然后,运行compass compile生成生产 CSS,运行compass compile -e development生成开发 CSS。

于 2013-07-01T11:47:09.243 回答