   )
 
 
-
 # -----------------------------------------------------------------------
 #  Production
 # -----------------------------------------------------------------------
-#
-# JS/CSS Minification, build an archive file
-#
 
-gulp.task '_minJS', ['_build'], ->
-  destDir = './dist/'
-  gulp.src('./dist/tutor.js')
-    .pipe(uglify())
-    .pipe(rename({extname: '.min.js'}))
-    .pipe(gulp.dest(destDir))
-
-gulp.task '_minCSS', ['_build'], ->
-  destDir = './dist/'
-  gulp.src('./dist/tutor.css')
-    # TODO: Remove the `procesImport:false` and host the fonts locally
-    .pipe(minifyCSS({keepBreaks:true, processImport:false}))
-    .pipe(rename({extname: '.min.css'}))
-    .pipe(gulp.dest(destDir))
-
-gulp.task '_min', ['_minJS', '_minCSS']
-
-gulp.task '_rev', ['_min'], ->
-  destDir = './dist/'
-  gulp.src('./dist/*.min.*')
+gulp.task '_archive', ['_build'], ->
+  destDir = './dist'
+  gulp.src("#{destDir}/*.min.*")
     .pipe(rev())
     .pipe(gulp.dest(destDir))
     .pipe(rev.manifest())
     .pipe(gulp.dest(destDir))
 
-gulp.task '_archive', ['_cleanArchive', '_build', '_min', '_rev'], ->
-  gulp.src([
-    './dist/tutor.min-*.js',
-    './dist/tutor.min-*.css',
-    './dist/fonts/*',
-    './dist/**/*.{svg,png,jpg}'], base: './dist')
+  gulp.src(["#{destDir}/*"], base: destDir)
     .pipe(tar('archive.tar'))
     .pipe(gzip())
-    .pipe(gulp.dest('./dist/'))
-
-gulp.task '_cleanArchive', (done) ->
-  del(['./dist/*.tar', './dist/*.gz'], done)
-
+    .pipe(gulp.dest(destDir))
 
 # -----------------------------------------------------------------------
 #  Development
 # -----------------------------------------------------------------------
 #
-# Start a webserver, watch files, lint files
-#
-
-gulp.task '_watchLint', ['lint'], ->
-  gulp.watch 'src/**/*.{cjsx,coffee}', ['lint']
-  gulp.watch 'test/**/*.coffee', ['lint']
-  gulp.watch '*.coffee', ['lint']
-
-
 gulp.task '_karma', ->
   server = new karma.Server(KARMA_CONFIG)
   server.start()

webpack         = require 'webpack'
webpackConfig   = require './webpack.config'
webpackServer   = require 'webpack-dev-server'
_ = require 'underscore'

KARMA_CONFIG =
  configFile: __dirname + '/test/karma.config.coffee'

  server = new karma.Server(config)
  server.start()

# same as TDD, not sure if anyone uses 'dev' ?
gulp.task 'dev', ['tdd']

gulp.task 'tdd', ['_cleanDist', '_webserver', '_karma']
