Last active
April 24, 2018 21:01
-
-
Save myxsys/17fa3467aac325365341 to your computer and use it in GitHub Desktop.
Gulp.js for OctoberCMS Theme
This file contains 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 $ = require('gulp-load-plugins')(); | |
livereload = require('gulp-livereload'); | |
//Compile Less into CSS | |
gulp.task('less', function() { | |
gulp.src('assets/less/*.less') | |
.pipe($.less()) | |
.pipe(gulp.dest('assets/css')) | |
.pipe(livereload()); | |
}); | |
//Lint Javascript | |
gulp.task('lint', function() { | |
return gulp.src('assets/javascript/app.js') | |
.pipe($.jshint()) | |
.pipe($.jshint.reporter('jshint-stylish')); | |
}); | |
//Watch for changes | |
gulp.task('watch', function() { | |
livereload.listen(); | |
gulp.watch('assets/less/**', ['less']); | |
gulp.watch('assets/javascript/*.js', ['lint']); | |
gulp.watch(['layouts/**','content/**','pages/**','partials/**','images/**']).on('change', livereload.changed); | |
}); | |
// The default task (called when you run `gulp` from cli) | |
gulp.task('default', ['less','lint','watch']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Install LiveReload on chrome.