Grunt contrib sass不';是否创建config.rb文件?

Grunt contrib sass不';是否创建config.rb文件?,sass,gruntjs,compass-sass,mixins,grunt-contrib-sass,Sass,Gruntjs,Compass Sass,Mixins,Grunt Contrib Sass,我使用的是Grunt Contrib Sass,似乎在任何地方都找不到config.rb文件(如果它正在创建一个)。我需要它为http_字体_路径分配一个路径,因为我正在使用Compass字体面混合,它似乎正在返回字体路径。“/fonts” 这是mixin代码: @import "compass/css3"; @include font-face("Tw Cen MT", font-files("..fonts/tw_cen_mt/Tw_Cen_MT-webfont.woff", "..font

我使用的是Grunt Contrib Sass,似乎在任何地方都找不到config.rb文件(如果它正在创建一个)。我需要它为http_字体_路径分配一个路径,因为我正在使用Compass字体面混合,它似乎正在返回字体路径。“/fonts”

这是mixin代码:

@import "compass/css3";
@include font-face("Tw Cen MT", font-files("..fonts/tw_cen_mt/Tw_Cen_MT-webfont.woff", "..fonts/tw_cen_mt/Tw_Cen_MT-webfont.ttf", "..fonts/tw_cen_mt/Tw_Cen_MT-webfont.svg"), "..fonts/tw_cen_mt/Tw_Cen_MT-webfont.eot");
@include font-face("New Cicle Gordita", font-files("..fonts/new_cicle_gordita/New_Cicle_Gordita-webfont.woff", "..fonts/new_cicle_gordita/New_Cicle_Gordita-webfont.ttf", "..fonts/new_cicle_gordita/New_Cicle_Gordita-webfont.svg"), "..fonts/new_cicle_gordita/New_Cicle_Gordita-webfont.eot");
下面是我得到的警告:

WARNING: 'Tw_Cen_MT-webfont.woff' was not found (or cannot be read) in ./fonts/..fonts/tw_cen_mt
WARNING: 'Tw_Cen_MT-webfont.ttf' was not found (or cannot be read) in ./fonts/..fonts/tw_cen_mt
WARNING: 'Tw_Cen_MT-webfont.svg' was not found (or cannot be read) in ./fonts/..fonts/tw_cen_mt
WARNING: 'Tw_Cen_MT-webfont.eot' was not found (or cannot be read) in ./fonts/..fonts/tw_cen_mt
WARNING: 'Tw_Cen_MT-webfont.eot?' was not found (or cannot be read) in ./fonts/..fonts/tw_cen_mt
WARNING: 'New_Cicle_Gordita-webfont.woff' was not found (or cannot be read) in ./fonts/..fonts/new_cicle_gordita
WARNING: 'New_Cicle_Gordita-webfont.ttf' was not found (or cannot be read) in ./fonts/..fonts/new_cicle_gordita
WARNING: 'New_Cicle_Gordita-webfont.svg' was not found (or cannot be read) in ./fonts/..fonts/new_cicle_gordita
WARNING: 'New_Cicle_Gordita-webfont.eot' was not found (or cannot be read) in ./fonts/..fonts/new_cicle_gordita
WARNING: 'New_Cicle_Gordita-webfont.eot?' was not found (or cannot be read) in ./fonts/..fonts/new_cicle_gordita
不用说,CSS文件中的输出与警告相同,而不是我最初在Sass文件mixin中输入的内容

当我使用不带“.”的路径时,它可以正常工作,并且不会将“/”字体添加到url中

@include font-face("Tw Cen MT", font-files("/tw_cen_mt/Tw_Cen_MT-webfont.woff", "/tw_cen_mt/Tw_Cen_MT-webfont.ttf", "/tw_cen_mt/Tw_Cen_MT-webfont.svg"), "/tw_cen_mt/Tw_Cen_MT-webfont.eot");
@include font-face("New Cicle Gordita", font-files("/new_cicle_gordita/New_Cicle_Gordita-webfont.woff", "/new_cicle_gordita/New_Cicle_Gordita-webfont.ttf", "/new_cicle_gordita/New_Cicle_Gordita-webfont.svg"), "/new_cicle_gordita/New_Cicle_Gordita-webfont.eot");

但是,这不是我希望在CSS文件中生成的url。

因此,基本上我在项目的根目录中添加了一个config.rb文件(grunt是从该目录运行的)

然后,我更改了字体面混合用法,如下所示:

@import "compass/css3";
@include font-face("Tw Cen MT", font-files("tw_cen_mt/Tw_Cen_MT-webfont.woff", "tw_cen_mt/Tw_Cen_MT-webfont.ttf", "tw_cen_mt/Tw_Cen_MT-webfont.svg"), "tw_cen_mt/Tw_Cen_MT-webfont.eot");
@include font-face("New Cicle Gordita", font-files("new_cicle_gordita/New_Cicle_Gordita-webfont.woff", "new_cicle_gordita/New_Cicle_Gordita-webfont.ttf", "new_cicle_gordita/New_Cicle_Gordita-webfont.svg"), "new_cicle_gordita/New_Cicle_Gordita-webfont.eot");
我意识到,如果路径以正斜杠“/”开头,那么它将直接用作路径;但是,如果我使用其他任何东西,它会在它之前添加http\u字体\u路径;不管是默认的还是用户指定的

@import "compass/css3";
@include font-face("Tw Cen MT", font-files("tw_cen_mt/Tw_Cen_MT-webfont.woff", "tw_cen_mt/Tw_Cen_MT-webfont.ttf", "tw_cen_mt/Tw_Cen_MT-webfont.svg"), "tw_cen_mt/Tw_Cen_MT-webfont.eot");
@include font-face("New Cicle Gordita", font-files("new_cicle_gordita/New_Cicle_Gordita-webfont.woff", "new_cicle_gordita/New_Cicle_Gordita-webfont.ttf", "new_cicle_gordita/New_Cicle_Gordita-webfont.svg"), "new_cicle_gordita/New_Cicle_Gordita-webfont.eot");