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

#     $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)
