 webpack         = require 'webpack'
 webpackConfig   = require './webpack.config'
 webpackServer   = require 'webpack-dev-server'
-_ = require 'underscore'
+ExtractTextPlugin = require 'extract-text-webpack-plugin'
 
 KARMA_CONFIG =
   configFile: __dirname + '/test/karma.config.coffee'

# -----------------------------------------------------------------------
#  Build Javascript and Styles using webpack
# -----------------------------------------------------------------------


gulp.task '_build', (done) ->
  webpack(webpackConfig, (err, stats) ->
    throw new gutil.PluginError("webpack", err) if err
    gutil.log("[webpack]", stats.toString({
      # output options

  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']
