Skip to content
This repository was archived by the owner on Dec 5, 2019. It is now read-only.
This repository was archived by the owner on Dec 5, 2019. It is now read-only.

SetImportDirs alias #362

Description

@Krinkle

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?

* foo/
** import-dirs/
*** shared/
**** variables.less

* bar/
** example.less

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:

* shared/
** variables.less

* bar/
** example.less

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions