Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Gulp with Live Reloading!
gulp = require 'gulp'
util = require 'gulp-util'
clean = require 'gulp-clean'
jade = require 'gulp-jade'
stylus = require 'gulp-stylus'
coffee = require 'gulp-coffee'
coffeelint = require 'gulp-coffeelint'
path = require 'path'
express = require 'express'
connectLivereload = require 'connect-livereload'
livereload = require 'gulp-livereload'
coffeelintOptions =
value: 120
gulp.task 'express', ->
app = express()
app.use connectLivereload()
app.use express.static 'public'
app.listen 9001
gulp.task 'clean', ->
gulp.src [
.pipe clean()
gulp.task 'jade', ->
gulp.src 'src/jade/**/*.jade'
.pipe jade()
.pipe gulp.dest 'public'
.pipe livereload()
gulp.task 'stylus', ->
gulp.src 'src/stylus/main.styl'
.pipe stylus()
.pipe gulp.dest 'public/css'
.pipe livereload()
gulp.task 'coffeescript', ->
gulp.src 'src/coffeescript/**/*.coffee'
.pipe coffeelint coffeelintOptions
.pipe coffeelint.reporter()
.pipe coffee()
.pipe gulp.dest 'public/js/compiled'
.pipe livereload()
gulp.task 'watch', -> 'src/jade/**/*.jade', ['jade'] 'src/stylus/*.styl', ['stylus'] 'src/coffeescript/**/*.coffee', ['coffeescript']
gulp.task 'default', [
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment