From 2635f30eeaf53d5e4561cb9267baba9094a3b60b Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Sun, 21 Feb 2016 18:01:27 +0200 Subject: [PATCH] Add proper clean task. --- gulpfile.js | 11 ++++++++--- package.json | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index f161fda34..221c7347e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,4 +1,3 @@ -// Main Gulp var gulp = require("gulp"); var runseq = require('run-sequence'); var clean = require("gulp-clean"); @@ -7,8 +6,8 @@ var plumber = require("gulp-plumber"); var autoprefixer = require('gulp-autoprefixer'); var watch = require("gulp-watch"); var cssmin = require("gulp-cssmin"); +var rimraf = require("rimraf"); -// Paths var paths = {}; paths.app = "./resources/"; paths.output = "./resources/public/"; @@ -42,6 +41,12 @@ gulp.task("styles:dist", function(next) { runseq("scss", "autoprefixer", next); }); +gulp.task("clean", function(next) { + rimraf(paths.output + "css/", function() { + rimraf(paths.output + "js/", next) + }); +}); + gulp.task("copy", function() { return gulp.src(paths.output + "/**/*.*") .pipe(gulp.dest(paths.dist)); @@ -49,7 +54,7 @@ gulp.task("copy", function() { // Default gulp.task("dist", function(next) { - runseq("styles:dist", "cssmin", "copy", next); + runseq("clean", "styles:dist", "cssmin", "copy", next); }); // Watch diff --git a/package.json b/package.json index 7eb06fc8e..579c812ff 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "scripts": { "watch": "gulp", "dist": "./scripts/dist && gulp dist", + "clean": "gulp clean", "figwheel": "./scripts/figwheel", "test-watch": "./scripts/watch", "test-build": "./scripts/build", @@ -23,6 +24,7 @@ "gulp-plumber": "1.1.0", "gulp-sass": "2.2.0", "gulp-watch": "4.3.5", + "rimraf": "2.5.2", "run-sequence": "1.1.5" }, "dependencies": {