Skip to content

Instantly share code, notes, and snippets.

@anttti
Last active August 29, 2015 14:11
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anttti/a387fa2c87b34de5d9f8 to your computer and use it in GitHub Desktop.
Save anttti/a387fa2c87b34de5d9f8 to your computer and use it in GitHub Desktop.
Basic Gulp config with livereload, sass, autoprefix, server
var gulp = require('gulp');
var sass = require('gulp-sass');
var webserver = require('gulp-webserver');
var livereload = require('gulp-livereload');
var autoprefixer = require('gulp-autoprefixer');
var del = require('del');
gulp.task('clean', function (cb) {
del(['dist/**'], cb);
});
gulp.task('sass', function() {
gulp.src('./sass/*.scss')
.pipe(sass({ errLogToConsole: true }))
.pipe(autoprefixer())
.pipe(gulp.dest('./css'))
.pipe(livereload());
});
gulp.task('watch', function() {
livereload.listen();
gulp.watch('./sass/*.scss', ['sass']);
});
gulp.task('server', function() {
gulp.src('.')
.pipe(webserver({
livereload: true
}));
});
gulp.task('build', ['clean'], function() {
gulp.src(['index.html', './js/**', './css/**', './fonts/**', './img/**'], { base: './' })
.pipe(gulp.dest('dist'));
});
gulp.task('default', ['sass', 'watch', 'server'], function() {});
@anttti
Copy link
Author

anttti commented Dec 17, 2014

To add: Uglify, eslint, jscs, cssmin, browserify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment