From bf2d9896db8465b86bd81ee4063f06bf8d3d9afd Mon Sep 17 00:00:00 2001 From: Alan Foster Date: Thu, 5 Nov 2015 14:08:33 +0000 Subject: [PATCH] Sequentially delete dist before building --- gulpfile.babel.js | 13 ++++++++----- package.json | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/gulpfile.babel.js b/gulpfile.babel.js index 60b27b07..03dc4ec7 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -9,6 +9,7 @@ import React from 'react'; import webpack from 'webpack'; import { Server as KarmaServer } from 'karma'; import clean from 'del'; +import runSequence from 'run-sequence'; const plugins = gulpLoadPlugins(); const PRODUCTION = (process.env.NODE_ENV === 'production'); @@ -113,7 +114,7 @@ gulp.task('clean-dist', function() { return clean('dist'); }); -gulp.task('build-dist-js', ['clean-dist'], function() { +gulp.task('build-dist-js', function() { // build javascript files return gulp.src(['src/**/*.{js,jsx}', '!src/**/tests/**', '!src/tests.webpack.js']) .pipe(plugins.babel({ @@ -131,7 +132,9 @@ gulp.task('build-dist-scss', function() { .pipe(gulp.dest('./dist/css')); }); -gulp.task('build-dist', ['clean-dist', 'build-dist-js', 'build-dist-scss']); +gulp.task('build-dist', function(callback) { + runSequence('clean-dist', ['build-dist-js', 'build-dist-scss'], callback); +}); gulp.task('build-example-js', function() { var compiler = plugins.webpack(webpackConfig, webpack); @@ -182,10 +185,10 @@ gulp.task('example-server', function() { }); }); -gulp.task('build', ['build-dist-js', 'build-example', 'build-example-js', 'build-example-scss']); +gulp.task('build', ['build-dist', 'build-example', 'build-example-js', 'build-example-scss']); gulp.task('develop', ['test-unit', 'build-example', 'watch-example-js', 'watch-example-scss', 'example-server']); gulp.task('deploy-example', ['build'], function() { - return gulp.src(paths.src) - .pipe(plugins.deploy()); + return gulp.src('./example/**/*') + .pipe(plugins.ghPages()); }); diff --git a/package.json b/package.json index 0de9757e..67472890 100644 --- a/package.json +++ b/package.json @@ -86,6 +86,7 @@ "karma-webpack": "^1.7.0", "object.assign": "^1.1.1", "phantomjs": "^1.9.18", + "run-sequence": "~1.1.4", "timekeeper": "0.0.5", "transform-loader": "^0.2.1", "underscore": "^1.8.3",