Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run clean task before build to remove previous build results #841

Merged
merged 3 commits into from
Nov 24, 2015
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ var gulp = require('gulp'),
sass = require('gulp-sass'),
please = require('gulp-pleeease'),
neat = require('node-neat'),
clean = require('gulp-clean'),
distPath = 'lib/dist',
fs = require('fs'),
chalk = require('chalk'),
Expand Down Expand Up @@ -57,6 +58,11 @@ gulp.task('assets', () => {
.pipe(gulp.dest(distPath + '/assets'));
});

gulp.task('clean-dist', function () {
return gulp.src(distPath, {read: false})
.pipe(clean());
});

// Copy test directives to output even when running gulp dev
gulp.task('dev:static', () => {
gulp.src(['lib/demo/**'])
Expand Down Expand Up @@ -121,7 +127,11 @@ gulp.task('dev', ['dev:doc', 'dev:static', 'dev:applystyles', 'dev:generate'], (
gulp.watch('lib/styleguide.js', ['dev:generate']);
});

gulp.task('build', ['sass', 'js:app', 'js:vendor', 'html', 'assets']);
gulp.task('buildDist', ['sass', 'js:app', 'js:vendor', 'html', 'assets']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you rename this task into build:dist. We use similar naming, with : in other tasks.


gulp.task('build', ['clean-dist'], () => {
runSequence('buildDist');
});

gulp.task('changelog', () => {

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@
"proxyquire": "~1.5.0",
"requirefrom": "~0.2.0",
"sinon": "~1.14.1",
"sinon-chai": "~2.8.0"
"sinon-chai": "~2.8.0",
"gulp-clean": "^0.3.1"
},
"scripts": {
"pretest": "gulp clean-coverage",
Expand Down