 LIB_TARGET_MIN = "nescoffee.min.js"
 LIB_DIR        = "./lib"
 LIB_SRC_DIR    = "#{LIB_DIR}/src"
+LIB_SRC_FILES  = "#{LIB_SRC_DIR}/{,*/}*.coffee"
 LIB_BUILD_DIR  = "#{LIB_DIR}/build"
 
 DIST_DIR    = "dist"
 DIST_JS_DIR = "#{DIST_DIR}/js"
 
+gulp.task "default", [ "build-lib" ]
+
+gulp.task "watch", ->
+    gulp.watch LIB_SRC_FILES, [ "build-lib" ]
+
 gulp.task "build-lib", ->
-    gulp.src "#{LIB_SRC_DIR}/{,*/}*.coffee"
+    gulp.src LIB_SRC_FILES
         .pipe coffee(
                 bare: true
                 inline: true

gulp    = require "gulp"
gutil   = require "gulp-util"
closure = require "gulp-closure-compiler"

bundle = require "./tasks/bundle-modules"

        .pipe gulp.dest DIST_JS_DIR

gulp.task "dist", [ "dist-lib" ]

gulp.task "clean", ->
    gulp.src [ LIB_BUILD_DIR, DIST_DIR ]
        .pipe rimraf()
