Paths to images not generated correctly when importing .less files using Web Essentials

我是研究僧i 提交于 2019-12-08 04:35:33

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!