-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.babel.js
102 lines (90 loc) · 2.12 KB
/
gulpfile.babel.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import gulp from 'gulp';
import {tasks, config, plugins as $} from './gulp/config/make-gulp-config';
const {sources, utils, environment} = config;
const {isDev} = environment;
const {testDir, buildDir} = sources;
const {addbase} = utils;
gulp.task('assemble', tasks.assemble);
gulp.task('browser-sync', tasks.browserSync);
gulp.task('clean', tasks.clean);
gulp.task('lint:test', tasks.eslint);
gulp.task('lint:build', tasks.eslint);
gulp.task('lint', ['lint:test', 'lint:build']);
gulp.task('rev', tasks.rev);
gulp.task('webpack:global', tasks.webpack);
gulp.task('webpack:main', tasks.webpack);
gulp.task('webpack', ['webpack:global', 'webpack:main']);
gulp.task('karma', tasks.karma);
gulp.task('selenium', tasks.selenium);
gulp.task('selenium:tunnel', tasks.selenium);
gulp.task('selenium:tunnel:live', tasks.selenium);
gulp.task('selenium:tunnel:mobile', tasks.selenium);
gulp.task('selenium:desktop', tasks.selenium);
gulp.task('build', (cb) => {
if (isDev) {
$.sequence(
['clean', 'lint'],
['assemble', 'webpack'],
'browser-sync',
cb
);
} else {
$.sequence(
['clean', 'lint'],
['rev', 'webpack'],
'assemble',
cb
);
}
});
gulp.task('test:integration', (cb) => {
$.sequence(
'lint',
'karma',
cb
);
});
gulp.task('test:e2e:mobile', (cb) => {
$.sequence(
'lint',
'selenium:tunnel:mobile',
cb
);
});
gulp.task('test:e2e:desktop', (cb) => {
$.sequence(
'lint',
'selenium:desktop',
cb
);
});
// this won't work properly becasue calling `process.exit`
gulp.task('test:e2e', (cb) => {
$.sequence(
'lint',
['selenium:desktop', 'selenium:tunnel:mobile'],
cb
);
});
gulp.task('test:tunnel', (cb) => {
$.sequence(
'lint',
'selenium:tunnel',
cb
);
});
gulp.task('test:tunnel:live', (cb) => {
$.sequence(
'lint',
'selenium:tunnel:live',
cb
);
});
gulp.task('default', ['build']);
gulp.task('watch', ['build'], () => {
gulp.watch(addbase(buildDir, '{js/,css/}**/*.{js,css}'), $.browserSync.reload);
gulp.watch([
addbase(testDir, '**/*.js'),
addbase(buildDir, '**/*.js')
], ['lint']);
});