0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-08 16:00:19 -05:00

Add proper clean task.

This commit is contained in:
Andrey Antukh 2016-02-21 18:01:27 +02:00
parent 64199f911b
commit 2635f30eea
2 changed files with 10 additions and 3 deletions

View file

@ -1,4 +1,3 @@
// Main Gulp
var gulp = require("gulp"); var gulp = require("gulp");
var runseq = require('run-sequence'); var runseq = require('run-sequence');
var clean = require("gulp-clean"); var clean = require("gulp-clean");
@ -7,8 +6,8 @@ var plumber = require("gulp-plumber");
var autoprefixer = require('gulp-autoprefixer'); var autoprefixer = require('gulp-autoprefixer');
var watch = require("gulp-watch"); var watch = require("gulp-watch");
var cssmin = require("gulp-cssmin"); var cssmin = require("gulp-cssmin");
var rimraf = require("rimraf");
// Paths
var paths = {}; var paths = {};
paths.app = "./resources/"; paths.app = "./resources/";
paths.output = "./resources/public/"; paths.output = "./resources/public/";
@ -42,6 +41,12 @@ gulp.task("styles:dist", function(next) {
runseq("scss", "autoprefixer", next); runseq("scss", "autoprefixer", next);
}); });
gulp.task("clean", function(next) {
rimraf(paths.output + "css/", function() {
rimraf(paths.output + "js/", next)
});
});
gulp.task("copy", function() { gulp.task("copy", function() {
return gulp.src(paths.output + "/**/*.*") return gulp.src(paths.output + "/**/*.*")
.pipe(gulp.dest(paths.dist)); .pipe(gulp.dest(paths.dist));
@ -49,7 +54,7 @@ gulp.task("copy", function() {
// Default // Default
gulp.task("dist", function(next) { gulp.task("dist", function(next) {
runseq("styles:dist", "cssmin", "copy", next); runseq("clean", "styles:dist", "cssmin", "copy", next);
}); });
// Watch // Watch

View file

@ -10,6 +10,7 @@
"scripts": { "scripts": {
"watch": "gulp", "watch": "gulp",
"dist": "./scripts/dist && gulp dist", "dist": "./scripts/dist && gulp dist",
"clean": "gulp clean",
"figwheel": "./scripts/figwheel", "figwheel": "./scripts/figwheel",
"test-watch": "./scripts/watch", "test-watch": "./scripts/watch",
"test-build": "./scripts/build", "test-build": "./scripts/build",
@ -23,6 +24,7 @@
"gulp-plumber": "1.1.0", "gulp-plumber": "1.1.0",
"gulp-sass": "2.2.0", "gulp-sass": "2.2.0",
"gulp-watch": "4.3.5", "gulp-watch": "4.3.5",
"rimraf": "2.5.2",
"run-sequence": "1.1.5" "run-sequence": "1.1.5"
}, },
"dependencies": { "dependencies": {