// Bundle gulp.task('bundle', function(cb) { var started = false; var config = require('./webpack.config.js'); var bundler = webpack(config); function bundle(err, stats) { if (err) { throw new $.util.PluginError('webpack', err); } if (argv.verbose) { $.util.log('[webpack]', stats.toString({colors: true})); } if (!started) { started = true; return cb(); } } if (watch) { bundler.watch(200, bundle); } else { bundler.run(bundle); } });