Created
March 25, 2015 15:13
-
-
Save tanaka51/b2c255a9933cf6e9f5e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gulp = require 'gulp' | |
util = require 'gulp-util' | |
source = require 'vinyl-source-stream' | |
browserify = require 'browserify' | |
watchify = require 'watchify' | |
gulp.task 'watch', -> | |
bundler = watchify browserify | |
entries: ['./src/index.coffee'] | |
extensions: ['coffee'] | |
transform: ['coffeeify'] | |
debug: true | |
bundle = -> | |
util.log 'index.coffee has compiled.' | |
bundler | |
.bundle() | |
.on 'error', (err) -> util.log 'Browserify Error: ', err | |
.pipe source 'app.js' | |
.pipe gulp.dest './public' | |
bundler.on 'update', bundle | |
bundle() | |
gulp.task 'default', ['watch'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment