diff --git a/gulpfile.js b/gulpfile.js index 1a1db21..0c2098d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -7,11 +7,16 @@ var nsp = require('gulp-nsp'); var babel = require('gulp-babel'); var watch = require('gulp-watch'); var batch = require('gulp-batch'); +var rimraf = require('rimraf'); // Initialize the babel transpiler so ES2015 files gets compiled // when they're loaded require('babel-core/register'); +gulp.task('clean', function(cb) { + rimraf('./dist', cb); +}); + gulp.task('static', function() { return gulp.src('**/*.js') .pipe(excludeGitignore()) @@ -29,7 +34,7 @@ gulp.task('test', function() { .pipe(mocha({reporter: 'spec'})); }); -gulp.task('babel', function() { +gulp.task('babel', ['clean'], function() { return gulp.src('lib/**/*.js') .pipe(babel()) .pipe(gulp.dest('dist')); diff --git a/package.json b/package.json index 99ef345..b8e3c3f 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "gulp-mocha": "^2.0.0", "gulp-nsp": "^0.4.5", "gulp-watch": "^4.3.4", - "lodash": "^3.0.0" + "lodash": "^3.0.0", + "rimraf": "^2.4.2" } }