New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gulp-less-glob

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-less-glob

Gulp task to use glob imports in your less files.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
57
decreased by-47.22%
Maintainers
1
Weekly downloads
 
Created
Source

Package Quality

Package Quality Build Status

gulp-less-glob

Gulp plugin for gulp-less to use glob imports.

Install

npm install gulp-less-glob --save-dev

Basic Usage

main.less

@import "vars/**/*.less";
@import "mixins/**/*.less";
@import "generic/**/*.less";
@import "../components/**/*.less";
@import "../views/**/*.less";
@import "../views/**/*something.less";
@import "../views/**/all.less";

NOTE: Also support using ' (single quotes) for example: @import 'vars/**/*.less';

gulpfile.js

var gulp = require('gulp');
var less = require('gulp-less');
var lessGlob = require('gulp-less-glob');

gulp.task('styles', function () {
    return gulp
        .src('src/styles/main.less')
        .pipe(lessGlob())
        .pipe(less())
        .pipe(gulp.dest('dist/styles'));
});

Ignoring files and directories by pattern

You can optionally provide an array of paths to be ignored. Any files and directories that match any of these glob patterns are skipped.

gulp.task('styles', function () {
    return gulp
        .src('src/styles/main.less')
          .pipe(lessGlob({
              ignorePaths: [
                  '**/_f1.less',
                  'recursive/*.less',
                  'import/**'
              ]
          }))
        .pipe(less())
        .pipe(gulp.dest('dist/styles'));
});

Troubleshooting

Nested glob imports

gulp-less-glob currently does NOT support nested glob imports i.e.

main.less

@import 'blocks/**/*.less';

blocks/index.less

@import 'other/blocks/**/*.less';

This will throw an error, because gulp-less-glob does NOT read nested import structures.

Solving nested glob imports

You have to think diffrent about your less folder structure, what I suggest to do is:

  • Point your gulp styles task ONLY to main.less
  • In main.less -> ONLY in this file I use glob imports

Contribute

Run tests

npm test

Build dist

npm run compile

Keywords

FAQs

Package last updated on 16 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc