Last active
December 9, 2016 05:18
-
-
Save SastraNababan/982365d0fa43bca1db5fd15964116982 to your computer and use it in GitHub Desktop.
Deploy Task
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Deploy to Build Directory | |
gulp.task('deploy',['cleanBuild'], function(){ | |
// optimasi css | |
var cssOptimize = gulp.src('app/css/*.css') | |
// .pipe(gutil.log('css Optimize Start')) | |
.pipe(cssnano()) | |
// .pipe(gutil.log('css Optimize Finish')) | |
.pipe(gulp.dest('build/css/')); | |
// menggabung semua file js dan optimasi | |
var jsOptimize = gulp.src('app/js/*.js') | |
.pipe(concat('all.js')) | |
.pipe(uglify()) | |
.pipe(gulp.dest('build/js')); | |
// optimasi image | |
var imgOptimize = gulp.src('app/images/*') | |
.pipe(imagemin()) | |
.pipe(gulp.dest('build/images')) | |
// optimasi html | |
var htmlOptimize = gulp.src('app/*.html') | |
.pipe(htmlmin({collapseWhitespace: true})) | |
.pipe(gulp.dest('build')); | |
return merge(cssOptimize,jsOptimize,imgOptimize,htmlOptimize); | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment