 
 
 #*-------------------------------------*\
-#      $CLEAN
+#			 $CLEAN
 #*-------------------------------------*/
 gulp.task 'clean:build', (done) ->
-  del "#{conf.path.prod.assets}/**/*", done
+	del ["#{conf.path.prod.assets}/**/*", "#{conf.path.dev.assets}/rev-manifest.json"], done
 
 
 
 
 
 #*-------------------------------------*\
-#      $BUILD
+#			 $BUILD
 #*-------------------------------------*/
 gulp.task 'build', () ->
-  runSequence "clean:build", ["rev:replace", "minify:js:vendors"]
+	runSequence "clean:build", "rev:fonts", "rev:images", ["rev:replace", "minify:js:vendors"]
 
 
 

#     $REV REPLACE
#     github.com/jamesknelson/gulp-rev-replace/issues/23
#*------------------------------------*/
gulp.task 'rev:replace', ["rev:css", "rev:js", "rev:fonts", "rev:images"], () ->
  manifest = require "./#{conf.path.dev.assets}/rev-manifest.json"
  stream = gulp.src ["./#{conf.path.prod.css}/#{manifest['style.css']}"]

  Object.keys(manifest).reduce((stream, key) ->
    stream.pipe replace(key, manifest[key])
  , stream)
    .pipe gulp.dest("./#{conf.path.prod.css}")






#*------------------------------------*\
#     $REV CSS
#*------------------------------------*/
gulp.task "rev:css", ["minify:css"], () ->
  gulp.src(["#{conf.path.dev.css}/style.min.css"])
    .pipe rename('style.css')
    .pipe rev()
    .pipe rename({suffix: '.min'})
    .pipe gulp.dest(conf.path.prod.css)
