Last active
August 29, 2015 14:01
-
-
Save razzius/e836f76aba129eb5dea5 to your computer and use it in GitHub Desktop.
gulp plumber
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 sass = require('gulp-sass'); | |
var browserify = require('gulp-browserify'); | |
var livereload = require('gulp-livereload'); | |
var plumber = require('gulp-plumber'); | |
var tinylr = require('tiny-lr')(); | |
var port = 35729; | |
gulp.task('watch', function() { | |
gulp.watch('./styles/sass/*.scss', ['sass']); | |
gulp.watch('./js/*.js', ['js']); | |
}); | |
gulp.task('js', function() { | |
gulp.src('./js/*.js') | |
.pipe(plumber()) | |
.pipe(browserify()) | |
.pipe(gulp.dest('./build/')) | |
.pipe(livereload(tinylr)); | |
}); | |
gulp.task('sass', function() { | |
gulp.src('./styles/sass/*.scss') | |
.pipe(plumber()) | |
.pipe(sass()) | |
.pipe(gulp.dest('./styles/css/')) | |
.pipe(livereload(tinylr)); | |
}); | |
gulp.task('serve', function() { | |
tinylr.listen(port, function() { | |
console.log('... Listening on %s ...', port); | |
}); | |
}); | |
gulp.task('build', ['js', 'sass']) | |
gulp.task('default', ['build', 'watch', 'serve']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment