Skip to content

Instantly share code, notes, and snippets.

@meleyal
Created March 25, 2014 16:46
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meleyal/9766072 to your computer and use it in GitHub Desktop.
Save meleyal/9766072 to your computer and use it in GitHub Desktop.
Gulp + Browserify + LiveReload
gulp = require 'gulp'
shell = require 'gulp-shell'
livereload = require 'gulp-livereload'
watchify = "watchify
app/assets/javascripts/initialize.coffee
--outfile app/assets/javascripts/bundle.js
--extension='.coffee'
--transform coffeeify
--transform debowerify
--transform browserify-eco
--debug"
browserify = "browserify
app/assets/javascripts/initialize.coffee
--outfile app/assets/javascripts/bundle.js
--extension='.coffee'
--transform coffeeify
--transform debowerify
--transform browserify-eco"
gulp.task 'watch', shell.task(watchify)
gulp.task 'build', shell.task(browserify)
gulp.task 'reload', ->
server = livereload()
gulp.watch './app/assets/javascripts/bundle.js'
.on 'change', (file) -> server.changed file.path
gulp.task 'default', ['watch', 'reload']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment