Last active
December 5, 2015 17:42
-
-
Save miclaus/cd8e3ee7a973eacdd1c9 to your computer and use it in GitHub Desktop.
Very simple gulp watch for coffeescript
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
/// 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