Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example Starter Gulp File for all of my projects
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
You can’t perform that action at this time.