lessc command cannot find import inside another import

57 views Asked by At

I have an issue with running lessc command when there is hierarchical imports. My folder structure is like this:

(root)/
|--- website
     |--- styles
          |--- master.less
|--- library
          |--- testDir
               |--- child.less
          |--- test.less

The short version of master.less:

@import url('../../library/test.less');

The short version of test.less:

@import url('/testDir/child.less'); 

When I run lessc website/styles/master.less website/styles/master.css, I am given FileError: '/testDir/child.less' wasn't found. Tried - /testDir/child.less, etc.

Note: It is not viable for me to use --include-path=./library/testDir option, because I have many instances of these hierarchical imports in my less files.

Any other option that I am missing, or a workaround?

0

There are 0 answers