Paths to images not generated correctly when impor

2019-06-01 00:55发布

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条回答
Emotional °昔
2楼-- · 2019-06-01 01:17

try it like my that: https://stackoverflow.com/a/16934685/676406

@import "..\..\..\folder2\subfolder1\subfolder2\styles\fear.less";

No leading slash and only backslashes.

查看更多
登录 后发表回答