   gulp.src STYLES_PATH
     .pipe stylus
       compress  : yes
-      # sourcemap : inline  : yes
+      sourcemap : inline  : yes  if devMode
     .pipe concat 'main.css'
     .pipe rename 'main.css'
-    # .pipe livereload()
+    .pipe gulpif devMode, livereload()
     .pipe gulp.dest "#{BUILD_PATH}/css"
 
 

SERVER_FILE = './server/server.coffee'
SERVER_PATH = ['./server/**/*.coffee']
BUILD_PATH  = argv.outputDir ? './static/a/out'

log = (color, message) -> gutil.log gutil.colors[color] message

watchLogger = (color, watcher) ->
  server = livereload()
  watcher.on 'change', (event) ->
    log color, "file #{event.path} was #{event.type}"
    server?.changed event.path

gulpBrowserify = (options = {}) ->
  options.extensions or= ['.coffee']
  options.debug       ?= yes
  b = browserify options
  b.transform coffeeify
  b.bundle()

      algorithm : 'binary-tree'
      padding   : 10
      cssFormat : 'stylus'
      cssVarMap : nameStylusVars.bind stream, '__2x'

  stream.css
    .pipe gulp.dest './app/styl/'

  stream.img
    .pipe gulp.dest "#{BUILD_PATH}/images/"

  return stream


gulp.task 'watch-styles', -> watchLogger 'cyan', gulp.watch STYLES_PATH, ['styles-only']
