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

Globbing Not Functioning #4

Closed
SpencerCarstens opened this issue Aug 5, 2015 · 7 comments
Closed

Globbing Not Functioning #4

SpencerCarstens opened this issue Aug 5, 2015 · 7 comments

Comments

@SpencerCarstens
Copy link

I can't get your plugin to work... I assume I'm doing something wrong.

Has anyone else gotten it to work?

Not getting any errors... just no output when I try to use globbing.

gulp.task( 'styles', () => {
  return gulp.src( [ 'app/styles/main.less' ] )
    .pipe( $.less( {
      plugins: [ require( 'less-plugin-glob' ) ],
    } ) )
    .pipe( gulp.dest( 'dist/styles' ) );
} );
// main.less
// Each line below is tried on it's own of course.
@import "app/module/waffle.less"; // Works
@import "app/module/**"; // Does not work.
@import "app/module/**/*"; // Does not work.
@import "app/module/**/*.less"; // Does not work.
@iamfrontender
Copy link

I just met exactly the same behaviour. Also noticed that less won't add rules from globbed files if they're empty.

@sonicparke
Copy link

I'm getting the same here as well.

@just-boris
Copy link
Owner

Well, so many people encountered that issue. But I have the same setup and it is work well

@just-boris
Copy link
Owner

Fine, got it.
Why are you imports declared from the app root? You should import relatively to this file.

@andyblount
Copy link

Had the same problem but as Boris says if you import relative to the file it works.

Is is possible to add functionality to make it work from the app root as well?

@just-boris
Copy link
Owner

Found that less implicitly adds extra path to search files here

if (!isAbsoluteFilename && paths.indexOf('.') === -1) { 
  paths.push('.'); 
}

I can't reuse this piece of code, only copy that to my plugin. I'll try to do it

@just-boris
Copy link
Owner

Seems to be fixed in my little example.
Please try to test current master in your projects, and if it is fine, I will make a release

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

No branches or pull requests

5 participants