-
Notifications
You must be signed in to change notification settings - Fork 15
/
gulpfile.js
31 lines (25 loc) · 817 Bytes
/
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
const gulp = require('gulp');
const webpack = require('webpack');
const gutil = require('gulp-util');
const builds = require('./dev/builds');
const Server = require('karma').Server;
function createWebpackCallback(callback) {
return (err, stats) => {
if (err) {
throw new gutil.PluginError("webpack", err);
}
gutil.log("[webpack]", stats.toString());
callback();
};
}
gulp.task('build:production', ['build:production:global'], callback => {
webpack(builds.production, createWebpackCallback(callback));
});
gulp.task('build:production:global', callback => {
webpack(builds.prodGlobal, createWebpackCallback(callback));
});
gulp.task('test', callback => {
new Server({
configFile: __dirname + '/karma.config.js'
}, callback).start();
});