-
Notifications
You must be signed in to change notification settings - Fork 23
/
gulpfile.js
38 lines (29 loc) · 1011 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', () => {
const rollupConfig = bundleHelper.getDefaultRollupConfig();
rollupConfig['external'].push('mapboxgl');
return bundleHelper.bundle('index.js', rollupConfig);
});
gulp.task('minify', ['build'], () => {
bundleHelper.minify();
});
gulp.task('watch', ['build'], () => {
gulp.watch(['index.js', './gulpfile.js'], ['build']);
});
gulp.task('runTest', () => {
// testHelper.test(karmaConfig);
});
gulp.task('test', ['build', 'runTest']);
gulp.task('tdd', ['build'], () => {
karmaConfig.singleRun = false;
gulp.watch(['index.js'], ['test']);
testHelper.test(karmaConfig);
});
gulp.task('default', ['watch']);