Created
October 12, 2014 14:50
-
-
Save Craga89/25452323fcfc6e4ac949 to your computer and use it in GitHub Desktop.
gulp-watch-less - Watch LESS files and their @imports for changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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