-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
39 lines (34 loc) · 1.11 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
'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('bundle:release', function (done) {
webpack(require('./webpack.config.release'), function (err, stats) {
if (err) throw new gutil.PluginError('webpack:build', err);
gutil.log('[bundle:release]', stats.toString({
colors: true
}));
done();
});
});
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
}));
});
});
gulp.task('default', ['bundle:dev'], function () {
});