 
 
 #*------------------------------------*\
+#     $AUTO RELOAD GULPFILE ON SAVE
+#     noxoc.de/2014/06/25/reload-gulpfile-js-on-change/
+#*------------------------------------*/
+gulp.task "auto_reload", () ->
+  process = undefined
+  restart = () ->
+    if process != undefined
+      process.kill()
+    process = spawn 'gulp', ['default'], {stdio: 'inherit'}
+
+  gulp.watch 'gulpfile.coffee', restart
+  restart()
+
+
+
+
+
+#*------------------------------------*\
 #     $UPDATE NPM DEPS
 #*------------------------------------*/
 gulp.task 'update_deps', shell.task 'npm-check-updates -u'
+
+
+
+
+
+#*-------------------------------------*\
+#      $CLEAN
+#*-------------------------------------*/
+gulp.task 'clean:build', (done) ->
+  del "#{conf.path.prod.assets}/**/*", done
+
+
+
+
+
+#*-------------------------------------*\
+#      $BUILD
+#*-------------------------------------*/
+gulp.task 'build', () ->
+  runSequence "clean:build", ["rev:replace", "minify:js:vendors"]
 
 
 

#*------------------------------------*/
gulp.task "watch", ["sass", "coffee", "browser-sync"], () ->
  gulp.watch "#{conf.path.dev.scss}/**/*.scss", ["sass"]
  gulp.watch "#{conf.path.dev.coffee}/**/*.coffee", ["coffee", "concat", "bs-reload"]
  gulp.watch "#{conf.path.dev.views}/**/*.html.php", ["bs-reload"]



moment       = require "moment"
pngquant     = require "imagemin-pngquant"
rsync        = require("rsyncwrapper").rsync
runSequence  = require "run-sequence"
spawn        = cp.spawn

pkg  = require "./package.json"
