问题
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
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'
.
That is incorrect because ../img does not exist from the sub directory. Any solution to this?
回答1:
try it like my that: https://stackoverflow.com/a/16934685/676406
@import "..\..\..\folder2\subfolder1\subfolder2\styles\fear.less";
No leading slash and only backslashes.
来源:https://stackoverflow.com/questions/16786054/paths-to-images-not-generated-correctly-when-importing-less-files-using-web-ess