1

I want to compile two .css files each time I save my style.sass file

For example :

style.dev.css for development with these options :

sass_options = {:debug_info => true}

And style.css for production with these options :

sass_options = {:debug_info => false}
output_style = :compressed
line_comments = false

The goal is to have a firesass ready css file on my local machine and the compressed version on svn. For the time being I have to edit config.rb each time I want to commit my change on svn.

Is it possible ?

4

1 に答える 1

0

まず第一に、bookcaseyが既に述べたように、コンパイルされた CSS をバージョン管理に保存するべきではありません。

フロントエンドを展開するには、git フックを使用します: Git フックを使用して、展開時に SASS を自動的に再コンパイルします

第二に、あなたが提案した解決策は、毎回構成を編集する煩わしさを解決しません。を編集する代わりにconfig.rb、HTML を編集して必要な CSS ファイルをロードする必要があります。

しかし、便利な回避策があります。

1)フラグ config.rbを使用するように変更します。environment

if environment == :development
  sass_options  = {:debug_info => false}
  output_style  = :compressed
  line_comments = false
else
  sass_options  = {:debug_info => true}
end

2) SASS をcompass compile -e development開発環境用に、vanillacompass compileを本番用にコンパイルします。

わーい!

于 2013-04-23T11:57:19.273 に答える