From 49201f539a9243957aaa9507af573508d8b2072c Mon Sep 17 00:00:00 2001 From: Aaron Jensen Date: Sun, 2 Aug 2015 00:48:08 -0700 Subject: [PATCH] clean before build --- gulpfile.js | 7 ++++++- package.json | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) 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" } }