Skip to content

Commit

Permalink
Add clean as dependency to other gulp taasks
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesprescottcollins committed Apr 30, 2015
1 parent d41f5ed commit b98d9a1
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ gulp.task('clean', function(cb) {
});

// minify profile images and move to dist
gulp.task('minify-profile-images', function() {
gulp.task('minify-profile-images', ['clean'], function() {
return gulp.src('src/img/*')
.pipe(imagemin({
progressive: true,
Expand All @@ -31,26 +31,28 @@ gulp.task('minify-profile-images', function() {
});

// remove unused profile css and minify
gulp.task('profile-css', function() {
gulp.task('profile-css', ['clean'], function() {
return gulp.src('./src/css/*.css')
.pipe(uncss({ html: './src/index.html'}))
.pipe(cssmin())
.pipe(gulp.dest('./dist/css/'));
});

// minify js
gulp.task('profile-js', function(){
gulp.task('profile-js', ['clean'], function(){
return gulp.src('./src/js/*.js')
.pipe(uglify())
.pipe(gulp.dest('./dist/js/'));
});

// optimize profile html
gulp.task('process-profile-html', function() {
gulp.task('process-profile-html', ['clean'], function() {
return gulp.src('./src/index.html')
// inline flagged css and js <link> and <script> references
.pipe(inlinesource({compress: true}))
// minify html
.pipe(minifyhtml())
.pipe(gulp.dest('./dist/'));
});

gulp.task('default', ['build-profile']);

0 comments on commit b98d9a1

Please sign in to comment.