Skip to content

Instantly share code, notes, and snippets.

@ryoppy
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryoppy/79577edb38fad9310169 to your computer and use it in GitHub Desktop.
Save ryoppy/79577edb38fad9310169 to your computer and use it in GitHub Desktop.
coffee, stylus, livereload
gulp = require('gulp')
coffee = require('gulp-coffee')
stylus = require('gulp-stylus')
nib = require('nib')
livereload = require('gulp-livereload')
wait = require('gulp-wait')
paths =
coffee:
in : ['js/**/*']
out : 'dist/js'
stylus:
in : ['css/**/*']
out : 'dist/css'
gulp.task 'coffee', ->
gulp.src paths.coffee.in
.pipe coffee()
.pipe gulp.dest paths.coffee.out
.pipe wait 300
.pipe livereload()
gulp.task 'stylus', ->
gulp.src paths.stylus.in
.pipe stylus({use: [nib()]})
.pipe gulp.dest paths.stylus.out
.pipe wait 300
.pipe livereload()
gulp.task 'watch', ->
livereload.listen()
gulp.watch paths.coffee.in, ['coffee']
gulp.watch paths.stylus.in, ['stylus']
gulp.task 'build', ['coffee', 'stylus']
gulp.task 'default', ['build', 'watch']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment