Skip to content

Instantly share code, notes, and snippets.

@ELLIOTTCABLE
Created May 23, 2013 02:14
Show Gist options
  • Select an option

  • Save ELLIOTTCABLE/5632377 to your computer and use it in GitHub Desktop.

Select an option

Save ELLIOTTCABLE/5632377 to your computer and use it in GitHub Desktop.
browserify = require 'browserify'
coffeeify = require 'coffeeify'
glob = require 'glob'
fs = require 'fs'
task 'compile:client', "bundle JavaScript through Browserify", (options) ->
bundle = browserify()
#watch: options.watch # FIXME: Lost in 1.0 -> 2.0
#cache: true # FIXME: Lost in 1.0 -> 2.0
#exports: ['equire', 'process'] # FIXME: Lost in 1.0 -> 2.0
bundle.transform coffeeify
bundle.ignore 'vm'
bundle.add path.join '.', config.dirs.source, 'Paws.coffee'
if options.tests
bundle.add file for file in glob.sync config.package.testling.files
fs.writeFile config.package.main.replace(/(?=\.(?:js|coffee))|$/, '.bundle'),
bundle.bundle
debug: yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment