Lessc with an absolute import path

I use lesscfor less compilation. However, I cannot import the absolute LESS file, lessc always says that the imported file was not found.

For instance,

A.less

@import /home/laptop/inc/inc.less
+5
source share
2 answers

In my testing, absolute paths do not work. Of course, the solution should make them relative ways. This way, when there are fewer files in my home directory (/ Users / Gidgidonihah)

/Volumes/remove/less/mixins.less

becomes

../../Volumes/remove/less/mixins.less
0
source

You need to put quotation marks around the name of your file and end it with a semicolon. Less is said very strictly about syntax.

@import "/home/laptop/inc/inc.less";
-2
source

All Articles