forked from mapbox/leaflet-omnivore
-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
37 lines (30 loc) · 984 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
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', (done) => {
bundleHelper.bundle('index.js');
done();
});
gulp.task('minify', gulp.series('build', (done) => {
bundleHelper.minify();
done();
}));
gulp.task('watch', gulp.series('build', (done) => {
gulp.watch(['index.js', './gulpfile.js'], gulp.series('build'));
done();
}));
gulp.task('test', gulp.series('build', (done) => {
testHelper.test(karmaConfig);
done();
}));
gulp.task('tdd', gulp.series('build', (done) => {
karmaConfig.singleRun = false;
gulp.watch(['index.js'], gulp.series('test'));
testHelper.test(karmaConfig);
done();
}));
gulp.task('default', gulp.series('watch'));