使用Web Essentials导入.less文件时,无法正确生成图像的路径 [英] Paths to images not generated correctly when importing .less files using Web Essentials
问题描述
Web Essentials的一个问题是图像的路径似乎生成不正确.例如,当我具有以下结构时:
An issue I'm having with Web Essentials is that the paths to my images seems to be generated incorrectly. For example, when I have this structure:
/css
main.less /* imports _sub.less */
main.css /* generated */
/css/subfolder
_sub.less
和_sub.less包含对具有'../img/some/folder/myimage.jpg'
的图像的引用,它在生成的css文件中以子文件夹为前缀.结果为'css/subfolder/../img/some/folder/myimage.jpg'
.
and _sub.less contains a reference to an images with '../img/some/folder/myimage.jpg'
, it gets prefixed by the subfolder in the generated css file. Resulting in 'css/subfolder/../img/some/folder/myimage.jpg'
.
那是不正确的,因为子目录中不存在../img.有什么解决办法吗?
That is incorrect because ../img does not exist from the sub directory. Any solution to this?
推荐答案
像我这样尝试: https://stackoverflow.com /a/16934685/676406
@import "..\..\..\folder2\subfolder1\subfolder2\styles\fear.less";
没有反斜杠,只有反斜杠.
No leading slash and only backslashes.
这篇关于使用Web Essentials导入.less文件时,无法正确生成图像的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!