Skip to content

Instantly share code, notes, and snippets.

@Craga89
Created October 12, 2014 14:50
Show Gist options
  • Select an option

  • Save Craga89/25452323fcfc6e4ac949 to your computer and use it in GitHub Desktop.

Select an option

Save Craga89/25452323fcfc6e4ac949 to your computer and use it in GitHub Desktop.
gulp-watch-less - Watch LESS files and their @imports for changes
var gulp = require('gulp');
var watchLess = require('gulp-watch-less');
var less = require('gulp-less');
// LESS compilter configuration
var lessConfig = {
paths: ['../imports']
};
gulp.task('less', function () {
return gulp.src('**/*.less')
.pipe(watchLess('less/file.less', {
name: 'LESS', // For output nice-ness!
less: lessConfig // Passed to LESS parser when generating list of @imports
}))
.pipe(less(lessConfig))
.pipe(gulp.dest('dist'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment