Search code examples
visual-studio-2010lessdotless

DotLess - How to import a LESS file in a parent folder?


I have this folders structure:

~/css/file1.less
~/css/folder/file2.less

What I want to do is importing file1.less inside file2.less, so in my file2.less I have this code:

@import "../file1.less";

This do not work, and the compiler crash when I build the project. I execute the compiler in Visual Studio 2010.

How can I import a less file placed in a parent folder?


Solution

  • This seems to be a bug in LESS.

    Comments in the bug report suggests that it is fixed in the main branch, so if you get the latest version from git, maybe it will work.

    See https://github.com/cloudhead/less.js/issues/177 and this post on StackOverflow: Node.js + Express.js. How to RENDER less css?