     .pipe gulp.dest './dist/'
     .pipe connect.reload()
 
-gulp.task 'watchify', ->
-  watcher = watchify(bundler)
-  watcher
-    .on 'error', gutil.log.bind(gutil, 'Browserify Error')
-    .on 'update', ->
-      watcher.bundle()
-        .pipe(source(jsBundleFile))
-        .pipe(buffer())
-        .pipe(sourcemaps.init({loadMaps: true}))
-        .pipe(sourcemaps.write('./'))
-        .pipe(gulp.dest('./dist/assets/js'))
-
-      gutil.log("Updated JavaScript sources")
-    .bundle()
-    .pipe(source(jsBundleFile))
-    .pipe(gulp.dest('./dist/assets/js'))
-    .pipe connect.reload()
 
 gulp.task 'watch', ['server'], ->
   gulp.watch ['./app/**/*.coffee'], ['coffee']
   gulp.watch ['./app/**/*.scss'], ['sass']
-  gulp.watch ['./app/**/*.js', './app/**/*.jsx'], ['watchify']
   gulp.watch ['./index.html', './app/**/*.html'], ['html']
 
 gulp.task 'assets', ->

argv = require('yargs').argv
autoprefixer = require 'gulp-autoprefixer'
browserify = require 'browserify'
buffer = require 'vinyl-buffer'


jsBundleFile = 'app-js.js'

gulp.task 'browserify', ->
  watcher = watchify(bundler)

  watcher.on 'update', ->
    updateStart = Date.now()
    console.log('Browserify started')
    watcher.bundle()
      .pipe(source(jsBundleFile))
        ## uglify
      .pipe(gulp.dest('./dist/assets/js'))
      .pipe(connect.reload())
    console.log('Browserify ended', (Date.now() - updateStart) + 'ms')
  .bundle()
  .pipe(source(jsBundleFile))
  .pipe(gulp.dest('./dist/assets/js'))
  .pipe(connect.reload())

gulp.task 'sass', ->
  gulp.src ['./app/**/*.scss']
