function webpack(config, watching) {
  var mode = $.util.colors.blue('[DEVELOPMENT]');
  if (isProduction) {
    mode = $.util.colors.green('[PRODUCTION]');
  }
  if (watching) {
    config.watch = !isBuildDev;
    config.debug = true;
  }
  $.util.log('Running webpack [SERVER] in ' + mode + ' mode');

  // Copy over user config if it exists
  gulp.start('copy:config');

  var packed = gulp.src(conf.ts.server)
    .pipe($.webpack(config))
    .pipe(gulp.dest(path.join(conf.paths.build, 'server')));

  if (argv.debug || argv.debugBrk) {
    setTimeout(function () {
      gulp.start('nodemon');
    }, 3000);
  }
  return packed;
}
/**
 * Run webpack to build files
 * @param {Object}  config    configuration for webpack
 * @param {Boolean} watching  whether or not to watch files
 */
Run webpack to build files
@param {Object}  config    configuration for webpack
@param {Boolean} watching  whether or not to watch files
Run webpack to build files @param { Object } config configuration for webpack @param { Boolean } watching whether or not to watch files
function webpack(config, watching) {
  var mode = $.util.colors.blue('[DEVELOPMENT]');
  if (isProduction) {
    mode = $.util.colors.green('[PRODUCTION]');
  }
  if (watching) {
    config.watch = !isBuildDev;
    config.debug = true;
  }
  $.util.log('Running webpack [SERVER] in ' + mode + ' mode');
  gulp.start('copy:config');
  var packed = gulp.src(conf.ts.server)
    .pipe($.webpack(config))
    .pipe(gulp.dest(path.join(conf.paths.build, 'server')));
  if (argv.debug || argv.debugBrk) {
    setTimeout(function () {
      gulp.start('nodemon');
    }, 3000);
  }
  return packed;
}
function webpack ( config , watching ) { var mode = $ . util . colors . blue ( '[DEVELOPMENT]' ) ; if ( isProduction ) { mode = $ . util . colors . green ( '[PRODUCTION]' ) ; } if ( watching ) { config . watch = ! isBuildDev ; config . debug = true ; } $ . util . log ( 'Running webpack [SERVER] in ' + mode + ' mode' ) ; gulp . start ( 'copy:config' ) ; var packed = gulp . src ( conf . ts . server ) . pipe ( $ . webpack ( config ) ) . pipe ( gulp . dest ( path . join ( conf . paths . build , 'server' ) ) ) ; if ( argv . debug || argv . debugBrk ) { setTimeout ( function ( ) { gulp . start ( 'nodemon' ) ; } , 3000 ) ; } return packed ; }
Run webpack to build files
 @param {Object}  config    configuration for webpack
 @param {Boolean} watching  whether or not to watch files
Run webpack to build files @param { Object } config configuration for webpack @param { Boolean } watching whether or not to watch files
// Copy over user config if it exists