Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@import with relative paths not resolving correctly #1083

Closed
pclifton opened this issue Dec 19, 2012 · 1 comment
Closed

@import with relative paths not resolving correctly #1083

pclifton opened this issue Dec 19, 2012 · 1 comment

Comments

@pclifton
Copy link

Given the following directory structure:

./app.less:
@import "subdir/lib.less";

./mixins.less:
/* These are mixins from the root dir */

./subdir/lib.less:
@import "mixins.less";

./subdir/mixins.less:
/* These are mixins from subdir */

If app.less is compiled from the root directory, lib.less includes the mixins from the root dir instead of the subdir:

lessc app.less
/* These are mixins from the root dir */

I discovered this while working with Bootstrap and also importing my own custom mixin file; when I tried to compile from my root less directory, Bootstrap was importing my mixins instead of boostrap/mixins since I gave mine the same name. Simply renaming my mixin file to something unique allows to me compile without problems, but this still seems like a problem with how lessc handles relative path imports.

It should be noted that these paths are handled correctly when rendering client-side with less.js, which is how I started developing. I only ran into this problem while trying to work out a build process using recess.

@lukeapage
Copy link
Member

Hrmm, you are right.. it searches the current directory first. If I change the current directory and run lessc again, I get a different behaviour. definitely a bug.

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

No branches or pull requests

2 participants