Last active
January 11, 2017 11:44
-
-
Save usamamuneerchaudhary/6033ecf9cb8dc6c6e14f7de1f1a61eab to your computer and use it in GitHub Desktop.
Example Starter Gulp File for all of my projects
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 concat = require('gulp-concat'); | |
var rename = require('gulp-rename'); | |
var sass = require('gulp-sass'); | |
var uglify = require('gulp-uglify'); | |
var cleancss = require('gulp-clean-css'); | |
var imgmin = require('gulp-imagemin'); | |
/** | |
* Styles Task | |
*/ | |
gulp.task('styles',function(){ | |
return gulp.src(['css/app.scss']) | |
.pipe(sass()) | |
.pipe(cleancss()) | |
.pipe(concat('main.css')) | |
.pipe(rename({suffix : '.min'})) | |
.pipe(gulp.dest('assets/css/')) | |
}); | |
/** | |
* Images Task | |
*/ | |
gulp.task('images', function () { | |
return gulp.src(['images/**/*']) | |
.pipe(imgmin()) | |
.pipe(gulp.dest('assets/images/')); | |
}); | |
/** | |
* Scripts Task | |
*/ | |
gulp.task('scripts', function(){ | |
return gulp.src([ | |
'js/jquery.js', | |
'js/audio.min.js', | |
'js/owl.carousel.min.js', | |
'js/jquery.flexslider-min.js', | |
'js/custom_flex.js' | |
]) | |
.pipe(concat('all.min.js')) | |
.pipe(uglify()) | |
.pipe(gulp.dest('assets/js/')) | |
}); | |
/** | |
* Watch Task | |
*/ | |
gulp.task('watch', function () { | |
gulp.watch('css/**/*.scss', ['styles']); | |
gulp.watch('js/*.js', ['scripts']); | |
}); | |
/** | |
* Default Task | |
*/ | |
gulp.task('default', ['styles','scripts','images','watch']); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment