 gulp = require 'gulp'
 gutil = require 'gulp-util'
 gulpif = require 'gulp-if'
-assign = require 'lodash.assign'
 minifycss = require 'gulp-minify-css'
 sass = require 'gulp-sass'
 source = require 'vinyl-source-stream'

    .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
assign = require 'lodash.assign'
autoprefixer = require 'gulp-autoprefixer'
browserify = require 'browserify'
buffer = require 'vinyl-buffer'
