I'm trying to make an extra directory (not relative to the currently parsed file) available to the parsed file. For this, the SetImportDirs method seems suitable, however I am unable to get it to work for a name. It only works for empty string, it seems?
With this setup, and SetImportDirs( [ '/foo/import-dirs/' => '' ] ), example.less is able to resolve @import "shared/variables"; without issue. This works as expected.
With this setup, and SetImportDirs( [ '/shared/' => 'shared' ] ), I expect example.less to be able to resolve @import "shared/variables";.
It seems the only way to make this work is to create a wrapper directory like "import-dirs" for every use case and to use empty string as uri value. Given the uri value is configurable, I assume it is intended to work differently, but I am unable to find how it is meant to work. I have tried many variations (leading and/or trailing slash, with ./, etc.).
Thanks for oyejorge/less.php.
I'm trying to make an extra directory (not relative to the currently parsed file) available to the parsed file. For this, the SetImportDirs method seems suitable, however I am unable to get it to work for a name. It only works for empty string, it seems?
With this setup, and
SetImportDirs( [ '/foo/import-dirs/' => '' ] )
,example.less
is able to resolve@import "shared/variables";
without issue. This works as expected.However, the following does not work:
With this setup, and
SetImportDirs( [ '/shared/' => 'shared' ] )
, I expectexample.less
to be able to resolve@import "shared/variables";
.It seems the only way to make this work is to create a wrapper directory like "import-dirs" for every use case and to use empty string as uri value. Given the uri value is configurable, I assume it is intended to work differently, but I am unable to find how it is meant to work. I have tried many variations (leading and/or trailing slash, with
./
, etc.).Thanks!