forked from geo-opensource/pivot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
68 lines (53 loc) · 1.94 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
'use strict';
var gulp = require('gulp');
var runSequence = require('run-sequence');
var laborer = require('laborer');
gulp.task('style', laborer.taskStyle());
gulp.task('icons', laborer.taskIcons());
var dontCache = !process.env['DONT_CACHE'];
var skipLibCheck = !process.env['DO_LIB_CHECK'];
gulp.task('client:tsc', laborer.taskClientTypeScript({ cache: dontCache, declaration: true, skipLibCheck: skipLibCheck }));
gulp.task('server:tsc', laborer.taskServerTypeScript({ cache: dontCache, declaration: true, skipLibCheck: skipLibCheck }));
gulp.task('client:test', laborer.taskClientTest({reporter: 'progress'}));
gulp.task('server:test', laborer.taskServerTest({reporter: 'progress'}));
gulp.task('common:test', laborer.taskCommonTest({reporter: 'progress'}));
gulp.task('client:bundle', laborer.taskClientPack());
gulp.task('clean', laborer.taskClean());
gulp.task('all', function(cb) {
laborer.failOnError();
runSequence(
'clean' ,
['style', 'icons'],
['server:tsc', 'client:tsc'],
'client:bundle',
cb
);
});
gulp.task('stats', function(cb) {
laborer.showStats();
gulp.start('all');
});
gulp.task('all-minus-bundle', function(cb) {
runSequence(
'clean' ,
['style', 'icons'],
['server:tsc', 'client:tsc'],
cb
);
});
gulp.task('watch', ['all-minus-bundle'], function() {
gulp.watch('./src/client/**/*.scss', ['style']);
gulp.watch('./src/client/**/*.svg', ['icons']);
if (process.env['NO_GULP_WATCH_TEST']) {
gulp.watch(['./src/common/**/*.ts', './src/client/**/*.{ts,tsx}', './assets/icons/**'], ['client:tsc']);
} else {
gulp.watch(['./src/common/**/*.ts', './src/client/**/*.{ts,tsx}', './assets/icons/**'], function() {
runSequence('client:tsc', ['client:test', 'common:test', 'server:test']);
});
}
gulp.watch(['./src/common/**/*.ts', './src/server/**'], ['server:tsc']);
if (!process.env['NO_GULP_WATCH_PACK']) {
laborer.clientPackWatch()
}
});
gulp.task('default', ['all']);