Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
514 views
in Technique[技术] by (71.8m points)

ruby - Sass/Compass compile into many locations

I'm using Sass 3.1.10 with Compass 0.11.5. I need to compile my compass project into many diffrent locations (css_dir) due some structural reasons. 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:

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
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I wrote a simple shell script to compile to a given path:

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/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...