Gruntjs yeoman构建指南针引导scss图像路径始终以前缀';为前缀/';

Gruntjs yeoman构建指南针引导scss图像路径始终以前缀';为前缀/';,gruntjs,yeoman,Gruntjs,Yeoman,问题在于引导sass,图标精灵路径在图像前始终以“../”前缀 “../../images/../images/glyphions半身人白色.png” 我希望像这样“../images/../images/glyph/halflings white.png” grunt文件配置: options: { sassDir: '<%= yeoman.app %>/styles', cssDir: '.tmp/styles', imagesDir: 'images

问题在于引导sass,图标精灵路径在图像前始终以“../”前缀

“../../images/../images/glyphions半身人白色.png”

我希望像这样“../images/../images/glyph/halflings white.png”

grunt文件配置:

  options: {
    sassDir: '<%= yeoman.app %>/styles',
    cssDir: '.tmp/styles',
    imagesDir: 'images',
    javascriptsDir: '<%= yeoman.app %>/scripts',
    fontsDir: '<%= yeoman.app %>/styles/fonts',
    importPath: '<%= yeoman.app %>/components',
    relativeAssets: true
  },
选项:{
sassDir:“/styles”,
cssDir:“.tmp/styles”,
imagesDir:“图像”,
javascriptsDir:“/scripts”,
fontsDir:“/styles/fonts”,
importPath:“/components”,
相对论:对
},

如何配置grunt文件以删除前缀。

以下是Compass任务的默认配置:

指南针:{
选项:{
sassDir:“/styles”,
cssDir:“.tmp/styles”,
generatedImagesDir:'.tmp/images/generated',
imagesDir:“/images”,
javascriptsDir:“/scripts”,
fontsDir:“/styles/fonts”,
导入路径:'/bower_components',
httpImagesPath:“/images”,
httpGeneratedImagesPath:“/images/generated”,
httpFontsPath:“/styles/fonts”,
相对论集:假
},
地区:{
选项:{
generatedImagesDir:“/images/generated”
}
},
服务器:{
选项:{
debugInfo:true
}
}
}
也许可以尝试与此同步,看看它是否会自行解决。

对我来说很有效:

    // The next line tells compass where to put the sprites
    // and the HTTP path to them.
    raw: 'http_images_path = "/images/"\ngenerated_images_dir = ".tmp/images"\nhttp_generated_images_path = "/images/"',
    // This doesn't work with relative paths.
    relativeAssets: false
    // The next line tells compass where to put the sprites
    // and the HTTP path to them.
    raw: 'http_images_path = "/images/"\ngenerated_images_dir = ".tmp/images"\nhttp_generated_images_path = "/images/"',
    // This doesn't work with relative paths.
    relativeAssets: false