diff --git a/dispatch/static/gulpfile.js b/dispatch/static/gulpfile.js index a2f5269d0..5ffee9368 100644 --- a/dispatch/static/gulpfile.js +++ b/dispatch/static/gulpfile.js @@ -2,6 +2,7 @@ var gulp = require('gulp'); var webpack = require('webpack-stream'); var sass = require('gulp-sass'); +var clean = require('gulp-clean'); gulp.task('sass', function () { return gulp.src('./src/styles/**/*.scss') @@ -9,10 +10,15 @@ gulp.task('sass', function () { .pipe(gulp.dest('./dist/css/')); }); -gulp.task('webpack', function() { +gulp.task('webpack', function () { return gulp.src('./src/js/**/*.jsx') .pipe(webpack( require('./webpack.config.js') )) .pipe(gulp.dest('./dist/js/')); }); -gulp.task('default', ['webpack', 'sass']); +gulp.task('clean', function () { + return gulp.src('./dist/', {read: false}) + .pipe(clean()); +}); + +gulp.task('default', ['clean', 'webpack', 'sass']); diff --git a/dispatch/static/package.json b/dispatch/static/package.json index 0bfb04f3f..d2e9291d8 100644 --- a/dispatch/static/package.json +++ b/dispatch/static/package.json @@ -16,6 +16,7 @@ "deep-diff": "^0.3.2", "dropzone": "^4.3.0", "gulp": "^3.9.0", + "gulp-clean": "^0.3.2", "gulp-rename": "^1.2.2", "gulp-sass": "^2.2.0", "lodash": "^4.6.1",