Sass / Compass可以编译到很多地方

我在Compass 0.11.5上使用了Sass 3.1.10。 由于某些结构性原因,我需要将我的指南针项目编译到许多不同的位置(css_dir)。 目前我手工编译每个路径的所有文件。 有没有一种方法可以同时编译到多个位置?

我的config.rb看起来像这样:

http_path = "/"

css_dir = "skin/main/css"
#css_dir = "uc/main/css"
#css_dir = "skin/abstract/css"
#css_dir = "skin/ksv/css"

sass_dir = "sass"


images_dir = "images"
javascripts_dir = "javascripts"

output_style = :compressed

preferred_syntax = :sass

我编写了一个简单的shell脚本来编译到给定的路径:

echo "* Compiling all CSS"


echo "***** START";
cd /mainworkspace/www/

echo "***** compiling into skin1";
compass compile --time --css-dir=skin1/main/css --output-style compressed --force;

echo "***** compiling into skin2";
compass compile --time --css-dir=skin2/main/css --output-style compressed --force;

echo "***** compiling into uc skin";
compass compile --time --css-dir=uc/main/css --output-style compressed --force;


echo "***** END";

更新:为生产添加了一些参数。 在这里你可以找到许多其他的可选参数:http://compass-style.org/help/documentation/configuration-reference/


这里是一个红宝石脚本的解决方案https://stackoverflow.com/a/39635064/6440953

链接地址: http://www.djcxy.com/p/91661.html

上一篇: Sass/Compass compile into many locations

下一篇: SASS/compass path in config.rb causing problem on compile