Created
September 23, 2015 16:59
-
-
Save akalongman/704d7cd5354b6a7e11dc to your computer and use it in GitHub Desktop.
Gulp file example
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
var gulp = require('gulp'); | |
var minifyCss = require('gulp-minify-css'); | |
var gulpConcat = require('gulp-concat'); | |
var uglify = require('gulp-uglify'); | |
var notify = require('gulp-notify'); | |
var cssFiles = [ | |
'public_html/res/css/bootstrap.css', | |
'public_html/res/css/datetimepicker.css', | |
'public_html/res/css/datepicker.css', | |
'public_html/res/css/fonts.css' | |
]; | |
var jsFiles =[ | |
'public_html/res/js/main.js', | |
'public_html/res/js/jquery.js', | |
'public_html/res/js/bootstrap.js' | |
]; | |
gulp.task('minify-js', function() { | |
return gulp.src(jsFiles) | |
//.pipe(uglify()) | |
.pipe(gulpConcat('script.min.js')) | |
.pipe(gulp.dest('public_html/res/js')) | |
//.pipe(notify({ message: 'Finished minifying JavaScript'})) | |
; | |
}); | |
gulp.task('minify-css', function() { | |
return gulp.src(cssFiles) | |
.pipe(minifyCss({ | |
keepSpecialComments: 0, | |
advanced: false, | |
aggressiveMerging: false | |
})) | |
.pipe(gulpConcat('style.min.css')) | |
.pipe(gulp.dest('public_html/res/css')) | |
//.pipe(notify('Finished minifying CSS')) | |
; | |
}); | |
gulp.task('default', ['minify-css']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment