-
Notifications
You must be signed in to change notification settings - Fork 18
/
gulpfile.js
38 lines (29 loc) · 989 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
32
33
34
35
36
37
'use strict';
const gulp = require('gulp'),
pkg = require('./package.json'),
BundleHelper = require('maptalks-build-helpers').BundleHelper,
TestHelper = require('maptalks-build-helpers').TestHelper;
const bundleHelper = new BundleHelper(pkg);
const testHelper = new TestHelper();
const karmaConfig = require('./karma.config');
gulp.task('build', () => {
return bundleHelper.bundle('index.js');
});
gulp.task('minify', gulp.series(['build'], done => {
bundleHelper.minify();
done();
}));
gulp.task('watch', gulp.series(['build'], () => {
gulp.watch(['index.js', './gulpfile.js'], gulp.series(['build']));
}));
gulp.task('runTest', done => {
testHelper.test(karmaConfig);
done();
});
gulp.task('test', gulp.series(['build', 'runTest']));
gulp.task('tdd', gulp.series(['build'], () => {
karmaConfig.singleRun = false;
gulp.watch(['index.js'], ['test']);
testHelper.test(karmaConfig);
}));
gulp.task('default', gulp.series(['watch']));