'use strict';

var gulp = require('gulp');
var webpack = require('webpack');
var gutil = require('gulp-util');

gulp.task('bundle:dev', function (done) {
    webpack(require('./webpack.config'), function (err, stats) {
        if (err) throw new gutil.PluginError('webpack:build', err);
        gutil.log('[bundle:dev]', stats.toString({
            colors: true
        }));
        done();
    });
});

gulp.task('default', ['bundle:dev'], function () {
});

'use strict';

var gulp = require('gulp');
var webpack = require('webpack');
var gutil = require('gulp-util');

gulp.task('bundle:dev', function (done) {
    webpack(require('./webpack.config'), function (err, stats) {
        if (err) throw new gutil.PluginError('webpack:build', err);
        gutil.log('[bundle:dev]', stats.toString({
            colors: true
        }));
        done();
    });
});

gulp.task('default', ['bundle:dev'], function () {
});

gulp.task('watch', function () {
    webpack(require('./webpack.config')).watch({
        aggregateTimeout: 300 // wait so long for more changes
    }, function (err, stats) {
        if (err) throw new gutil.PluginError('watch', err);
        gutil.log('[watch]', stats.toString({
            colors: true
        }));
    });
});
add watch functionality