From ffbaf87cf58b0e4106869ec510370cc8e8d10185 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Sun, 21 Feb 2016 20:50:26 +0200 Subject: [PATCH] More fixes on deploy scripts. --- gulpfile.js | 21 ++++++++++++--------- package.json | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 94850b737..2d49e57f8 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -12,12 +12,13 @@ var paths = {}; paths.app = "./resources/"; paths.output = "./resources/public/"; paths.dist = "./dist/"; +paths.target = "./target/"; paths.scss = paths.app + "styles/**/*.scss"; gulp.task("scss", function() { return gulp.src(paths.app + "styles/main.scss") .pipe(plumber()) - .pipe(scss({ style: "expanded" })) + .pipe(scss({style: "expanded"})) .pipe(gulp.dest(paths.output + "css/")); }); @@ -33,21 +34,23 @@ gulp.task("cssmin", function() { .pipe(gulp.dest(paths.output + "css/")); }); -gulp.task("styles:dev", function(next) { +gulp.task("styles-dev", function(next) { runseq("scss", "autoprefixer", next); }); -gulp.task("styles:dist", function(next) { +gulp.task("styles-dist", function(next) { runseq("scss", "autoprefixer", next); }); -gulp.task("clean:dist", function(next) { - rimraf(paths.dist + "**/*", next); +gulp.task("clean-dist", function(next) { + rimraf(paths.dist, next); }); -gulp.task("clean:public", function(next) { +gulp.task("clean", function(next) { rimraf(paths.output + "css/", function() { - rimraf(paths.output + "js/", next); + rimraf(paths.output + "js/", function() { + rimraf(paths.target, next); + }); }); }); @@ -58,10 +61,10 @@ gulp.task("copy", function() { // Default gulp.task("dist", function(next) { - runseq("clean:public", "styles:dist", "cssmin", "clean:dist", "copy", next); + runseq("styles-dist", "cssmin", "clean-dist", "copy", next); }); // Watch -gulp.task("default", ["styles:dev"], function () { +gulp.task("default", ["styles-dev"], function () { gulp.watch(paths.scss, ["autoprefixer"]); }); diff --git a/package.json b/package.json index 579c812ff..0dc2bec0c 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ }, "scripts": { "watch": "gulp", - "dist": "./scripts/dist && gulp dist", + "dist": "gulp clean && ./scripts/dist && gulp dist", "clean": "gulp clean", "figwheel": "./scripts/figwheel", "test-watch": "./scripts/watch",