这两个变量$slick-font-path
和$slick-loader-path
仅用作缺少image-url
和font-url
功能的后备,通常由 Compass 提供(请参阅:http ://compass-style.org/reference/compass/helpers/urls/#image-url )。
您唯一需要做的就是在grunt-contrib-compass
( https://github.com/gruntjs/grunt-contrib-compass )提供的 Gruntfile 中定义图像和字体的默认目录
这是我项目的 Gruntfile 中的一个片段。只需查看该部分中的imagesDir
和fontsDir
行dist
。其余的在您的项目中可能看起来不同。
compass: {
options: {
debugInfo: false,
imagesDir: ['src/assets/img'],
raw: [
'http_path = "/"',
'Sass::Script::Number.precision = 8',
'sass_options = {',
' :read_cache => true,',
'}'
].join("\n"),
require: ['sass-globbing'],
importPath: ['bower_components/foundation/scss', 'bower_components/slick.js/slick'],
sassDir: ['src/assets/scss']
},
dist: {
options: {
cssDir: ['dist/assets/css'],
imagesDir: ['dist/assets/img'],
fontsDir: ['dist/assets/fonts'],
environment: 'development',
force: true,
javascriptsDir: 'build/js',
noLineComments: false,
outputStyle: 'expanded',
raw: [
'sass_options = {',
' :sourcemap => true', // this set to 'true' has no effect, if you aren't using sass >= 3.3
'}'
].join("\n"),
sourcemap: true // this set to 'true' has no effect, if you aren't using sass >= 3.3
}
}
}
希望这可以帮助。