     .pipe filter('!**/main.ls')
     .pipe lsc({bare:true}) .on 'error', gutil.log
     .pipe cond isRelease, uglify()
-    .pipe gulp.dest (path.join outputdir, 'lib')
+    .pipe gulp.dest (out 'lib')
 
 gulp.task 'browserify', ['script'], ->
   gulp.src SOURCES

    .pipe lsc({bare:true}) .on 'error', gutil.log
    .pipe browserify()
    .pipe cond isRelease, uglify()
    .pipe gulp.dest (path.join outputdir, 'lib')
    .pipe (livereload server)

gulp.task 'stylus', ->
  gulp.src STYLUSES
    .pipe (stylus {bare: true}) .on 'error', gutil.log
    .pipe cond isRelease, minifyCss()
    .pipe (gulp.dest (path.join outputdir, 'css'))
    .pipe (livereload server)

gulp.task 'html', ->

  gulp.src HTMLS
    .pipe cond isRelease, minifyHTML {empty:true, cdata: true}
    .pipe cond (not isRelease), header reload_script, {}
    .pipe (gulp.dest out())
    .pipe (livereload server)

gulp.task 'image', ->
    gulp.src IMAGES
        .pipe minImage({progressive:true})
        .pipe gulp.dest (out 'img')

gulp.task 'bower', ->
#  bower()
#    .pipe cond isRelease, uglify({preserveComments:'some'})
#    .pipe flatten()
#    .pipe (gulp.dest (out 'lib'))
#    .pipe (livereload server)

gulp.task 'copy', ->
  gulp.src 'third_party/**/*.js'
    .pipe cond isRelease, uglify({preserveComments:'some'})
    .pipe (gulp.dest (out 'lib'))
    .pipe (livereload server)
  gulp.src 'data/*.gexf'
    .pipe (gulp.dest (out 'data'))
    
gulp.task 'watch', ->
  server.listen 35729, (err) ->
