'use strict';
var fs = require('fs');
var _path = require('path');

var async = require('async');
var webpack = require('webpack');

var webpackConfig = require('../config/build');
var utils = require('./utils');

module.exports = function(config) {
  config.buildDev = 1;

  return new Promise(function(resolve, reject) {
    webpackConfig(config).then(function(c) {
      webpack(c, function(err) {
        if(err) {
          return reject(err);
        }

        var buildDir = _path.join(process.cwd(), './.antwar/build');
        var renderPage = require(_path.join(buildDir, 'bundleStaticPage.js'));

        async.parallel([
          function(cb) {
            renderPage('antwar_devindex', function(err, html) {
              if(err) {
                return cb(err);
              }

              fs.writeFile(
                _path.join(buildDir, 'index.html'),
                html,
                cb
              );
            });
          },
          utils.copyIfExists.bind(null, './assets', _path.join(buildDir, 'assets')),
          utils.copyExtraAssets.bind(null, buildDir, config.assets)
        ], function(err) {
          if(err) {
            return reject(err);
          }

          resolve();
        });
      });
    }).catch(function(err) {
      reject(err);
    });
  });
};

@@ -382,32 +382,39 @@
 (c, function(err
+, stats
 ) %7B%0A        if(e
@@ -452,32 +452,98 @@
 rr);%0A        %7D%0A%0A
+        // TODO: dig build errors from stats.compilation.modules%0A%0A
         var buil

Add TODO