简体   繁体   English

Sass / Compass编译到很多地方

[英]Sass/Compass compile into many locations

I'm using Sass 3.1.10 with Compass 0.11.5. 我正在使用Sass 3.1.10和Compass 0.11.5。 I need to compile my compass project into many diffrent locations (css_dir) due some structural reasons. 由于某些结构原因,我需要将我的指南针项目编译到许多不同的位置(css_dir)。 Currently I compile all files for each path by hand. 目前,我手动编译每个路径的所有文件。 Is there a way to compile into many locations at the same time? 有没有办法同时编译到许多位置?

my config.rb looks like this: 我的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

I wrote a simple shell script to compile to a given path: 我写了一个简单的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";

update: added some params for production. 更新:为生产添加了一些参数。 Here you can find many other optional params: http://compass-style.org/help/documentation/configuration-reference/ 在这里你可以找到许多其他可选参数: http//compass-style.org/help/documentation/configuration-reference/

这是一个带有ruby脚本的解决方案https://stackoverflow.com/a/39635064/6440953

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM