Skip to content

Instantly share code, notes, and snippets.

@winton
Last active August 29, 2015 14:18
Show Gist options
  • Select an option

  • Save winton/7811015fd6ee7b523232 to your computer and use it in GitHub Desktop.

Select an option

Save winton/7811015fd6ee7b523232 to your computer and use it in GitHub Desktop.
Gulp task to compile and browserify a client coffeescript
gulp = require "gulp"
browserify = require "browserify"
coffee = require "gulp-coffee"
transform = require "vinyl-transform"
gulp.task "coffee", ->
gulp
.src "./app/scripts/**/*.coffee"
.pipe coffee bare: true
.pipe gulp.dest("./dist/lib")
gulp.task "scripts", [ "coffee" ], ->
gulp
.src("./dist/app/scripts/client.js")
.pipe(browserified)
.pipe gulp.dest("./dist/app")
browserified = transform (filename) ->
b = browserify(entries: filename, debug: true)
b.bundle()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment