Skip to content

Instantly share code, notes, and snippets.

@myxsys
Last active April 24, 2018 21:01
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save myxsys/17fa3467aac325365341 to your computer and use it in GitHub Desktop.
Save myxsys/17fa3467aac325365341 to your computer and use it in GitHub Desktop.
Gulp.js for OctoberCMS Theme
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']);
@myxsys
Copy link
Author

myxsys commented Feb 10, 2015

Install LiveReload on chrome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment