Skip to content

Instantly share code, notes, and snippets.

@miclaus
Last active December 5, 2015 17:42
Show Gist options
  • Save miclaus/cd8e3ee7a973eacdd1c9 to your computer and use it in GitHub Desktop.
Save miclaus/cd8e3ee7a973eacdd1c9 to your computer and use it in GitHub Desktop.
Very simple gulp watch for coffeescript
/// requires
var gulp = require('gulp'),
plumber = require('gulp-plumber'),
coffee = require('gulp-coffee'),
watch = require('gulp-watch');
/// dirs
var assets_dir = 'assets/';
var coffee_dir = assets_dir + 'coffee/',
js_dir = assets_dir + 'js/';
/// tasks
gulp.task('default', function ()
{
gulp.src( coffee_dir + '*.coffee')
.pipe( plumber({ errorHandler : errorHandler }) )
.pipe( watch( coffee_dir + '*.coffee' ) )
.pipe( coffee() )
.pipe( gulp.dest( js_dir ) );
});
/// functions
errorHandler = function (error)
{
console.error(error);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment