Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Gulp with Live Reloading!

View gulpfile.coffee
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
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 =
max_line_length:
value: 120
 
gulp.task 'express', ->
app = express()
app.use connectLivereload()
app.use express.static 'public'
app.listen 9001
 
gulp.task 'clean', ->
gulp.src [
'public/js/compiled'
'public/css'
'public/**/*.html'
]
.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', ->
gulp.watch 'src/jade/**/*.jade', ['jade']
gulp.watch 'src/stylus/*.styl', ['stylus']
gulp.watch 'src/coffeescript/**/*.coffee', ['coffeescript']
 
gulp.task 'default', [
'jade'
'stylus'
'coffeescript'
'express'
'watch'
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.