 #   $TASKS
 #*------------------------------------*/
 gulp.task 'default', ['watch']
-gulp.task "build", ["uglify", "minify"]
+gulp.task "build", ["uglify", "minify", "font", "imagemin", "rev_replace"]
 
 # No exsisting gulp task implemented
 # grunt's devUpdate:check alternative

#   $SASS
#*------------------------------------*/
gulp.task "minify", () ->
	gulp.src([conf.path.css + "/style.css"])
		.pipe minifyCSS({keepSpecialComments: 0})
		.pipe rev()
		.pipe rename({suffix: '.min'})

		.pipe gulp.dest('./')


#*------------------------------------*\
#   $REV REPLACE
# 	github.com/jamesknelson/gulp-rev-replace/issues/23
#*------------------------------------*/
gulp.task 'rev_replace', ["uglify", "minify", "font", "imagemin"], () ->
	manifest = require "./#{conf.path.pvt.assets}/rev-manifest.json"
	stream = gulp.src ["./#{conf.path.pub.css}/#{manifest['style.css']}"]

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


#*------------------------------------*\
