Skip to content

Commit 90e61ef

Browse files
committed
refactor: consolidate collection of standalone Gulp clean tasks into just one
1 parent 7a982d6 commit 90e61ef

1 file changed

Lines changed: 7 additions & 23 deletions

File tree

packages/uikit-workshop/gulpfile.js

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,12 @@ function copyPublic(suffix) {
2020
}
2121

2222
/* clean tasks */
23-
gulp.task('clean:bower', function(cb) {
24-
return plugins.del(['dist/styleguide/bower_components/*'], cb);
25-
});
26-
27-
gulp.task('clean:css', function(cb) {
28-
return plugins.del(['dist/styleguide/css/*'], cb);
29-
});
30-
31-
gulp.task('clean:html', function(cb) {
32-
return plugins.del(['dist/*.html'], cb);
33-
});
34-
35-
gulp.task('clean:images', function(cb) {
36-
return plugins.del(['dist/styleguide/images/*'], cb);
37-
});
38-
39-
gulp.task('clean:js', function(cb) {
40-
return plugins.del(['dist/styleguide/js/*'], cb);
23+
gulp.task('clean', function(cb) {
24+
return plugins.del(['dist'], cb);
4125
});
4226

4327
/* core tasks */
44-
gulp.task('build:bower', ['clean:bower'], function() {
28+
gulp.task('build:bower', ['clean'], function() {
4529
return gulp
4630
.src(plugins.mainBowerFiles())
4731
.pipe(plugins.rename({ suffix: '.min' }))
@@ -50,12 +34,12 @@ gulp.task('build:bower', ['clean:bower'], function() {
5034
.pipe(copyPublic('styleguide/bower_components'));
5135
});
5236

53-
gulp.task('build:css', function() {
5437
return plugins
5538
.rubySass('src/sass/pattern-lab.scss', {
5639
style: 'expanded',
5740
'sourcemap=none': true,
5841
})
42+
gulp.task('build:css', ['clean'], function() {
5943
.src([
6044
'src/sass/pattern-lab.scss',
6145
'src/sass/pattern-lab--iframe-loader.scss',
@@ -87,7 +71,7 @@ gulp.task('build:html', ['clean:html'], function() {
8771
.pipe(copyPublic(''));
8872
});
8973

90-
gulp.task('build:images', ['clean:images'], function() {
74+
gulp.task('build:images', ['clean'], function() {
9175
return gulp
9276
.src('src/images/*')
9377
.pipe(
@@ -101,7 +85,7 @@ gulp.task('build:images', ['clean:images'], function() {
10185
.pipe(copyPublic('styleguide/images'));
10286
});
10387

104-
gulp.task('build:js-viewer', ['clean:js'], function() {
88+
gulp.task('build:js-viewer', ['clean'], function() {
10589
return gulp
10690
.src(['src/js/*.js', '!src/js/modal-styleguide.js'])
10791
.pipe(plugins.jshint('.jshintrc'))
@@ -120,7 +104,7 @@ gulp.task('build:js-viewer', ['clean:js'], function() {
120104
.pipe(copyPublic('styleguide/js'));
121105
});
122106

123-
gulp.task('build:js-pattern', ['build:js-viewer'], function() {
107+
gulp.task('build:js-pattern', ['clean', 'build:js-viewer'], function() {
124108
// 'src/js/annotations-pattern.js','src/js/code-pattern.js','src/js/info-panel.js'
125109
return gulp
126110
.src([

0 commit comments

Comments
 (0)