Skip to content

Commit

Permalink
Sequentially delete dist before building
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanFoster committed Nov 5, 2015
1 parent 414fce3 commit bf2d989
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
13 changes: 8 additions & 5 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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({
Expand All @@ -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);
Expand Down Expand Up @@ -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());
});
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit bf2d989

Please sign in to comment.