diff --git a/gulpfile.js b/gulpfile.js index 6079e71..677ca78 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -5,6 +5,8 @@ var excludeGitignore = require('gulp-exclude-gitignore'); var mocha = require('gulp-mocha'); var nsp = require('gulp-nsp'); var babel = require('gulp-babel'); +var watch = require('gulp-watch'); +var batch = require('gulp-batch'); // Initialize the babel transpiler so ES2015 files gets compiled // when they're loaded @@ -33,5 +35,11 @@ gulp.task('babel', function () { .pipe(gulp.dest('dist')); }); +gulp.task('watch', function () { + watch(['lib/**/*.js', 'test/**/*.js'], batch(function (events, done) { + gulp.start('test', done); + })); +}); + gulp.task('prepublish', ['nsp', 'babel']); gulp.task('default', ['static', 'test']); diff --git a/package.json b/package.json index f21ba1e..eb5e846 100644 --- a/package.json +++ b/package.json @@ -35,10 +35,12 @@ "eslint-config-airbnb": "0.0.7", "gulp": "^3.6.0", "gulp-babel": "^5.1.0", + "gulp-batch": "^1.0.5", "gulp-eslint": "^0.15.0", "gulp-exclude-gitignore": "^1.0.0", "gulp-mocha": "^2.0.0", "gulp-nsp": "^0.4.5", + "gulp-watch": "^4.3.4", "lodash": "^3.0.0" } }