Created
February 7, 2014 00:14
-
-
Save ericdouglas/8855182 to your computer and use it in GitHub Desktop.
Error gulpifle
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
// error | |
var gulp = require('gulp'); | |
var jade = require('gulp-jade'); | |
var stylus = require('gulp-stylus'); | |
var EXPRESS_PORT = 4000; | |
var EXPRESS_ROOT = __dirname; | |
var LIVERELOAD_PORT = 35729; | |
var lr; | |
gulp.task('jade', function () { | |
gulp.src('./*.jade') | |
.pipe(jade()) | |
.pipe(gulp.dest('./public')); | |
}); | |
gulp.task('stylus', function () { | |
gulp.src('./*.styl') | |
.pipe(stylus()) | |
.pipe(gulp.dest('./public')); | |
}); | |
gulp.task('express', function () { | |
var express = require('express'); | |
var app = express(); | |
app.use(require('connect-livereload')()); | |
app.use(express.static(EXPRESS_ROOT)); | |
app.listen(EXPRESS_PORT); | |
}); | |
gulp.task('livereload', function () { | |
lr = require('tiny-lr')(); | |
lr.listen(LIVERELOAD_PORT); | |
}); | |
gulp.task('notify-lr', function () { | |
gulp.src(event.path, {read: false}) | |
.pipe(require('gulp-livereload')(lr)); | |
}); | |
gulp.task('watch', function () { | |
gulp.watch('*.jade', ['jade']); | |
gulp.watch(['public/*.html'], notifyLivereload); | |
gulp.watch('*.styl', ['stylus']); | |
gulp.watch(['public/*.css'], notifyLivereload); | |
}); | |
gulp.task('default', [ 'express', 'livereload', 'jade', 'stylus', 'notify-lr', 'watch' ]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment