-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.babel.js
52 lines (40 loc) · 1.99 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
/* global process */
import gulp from 'gulp';
import PrettyError from 'pretty-error';
import './build/gulp/tasks/php';
import './build/gulp/tasks/svg';
import './build/gulp/tasks/favicon';
import './build/gulp/tasks/scripts';
import './build/gulp/tasks/styles';
import './build/gulp/tasks/tests';
import './build/gulp/tasks/watch';
import './build/gulp/tasks/clean';
import './build/gulp/tasks/browsersync';
// Pretty error printing
new PrettyError().start();
// Throw unhandled promise rejection
process.on('unhandledRejection', (e) => { throw e; });
// ------------------------------------------------------------------------------------------
// TASK: lint
// ------------------------------------------------------------------------------------------
gulp.task('lint', gulp.series('lint-php', gulp.parallel('lint-scripts', 'lint-styles')));
// ------------------------------------------------------------------------------------------
// TASK: compile
// ------------------------------------------------------------------------------------------
gulp.task('compile', gulp.parallel('compile-scripts', 'compile-styles'));
// ------------------------------------------------------------------------------------------
// TASK: default
// ------------------------------------------------------------------------------------------
gulp.task('default', gulp.series(
'clean',
'lint-php',
gulp.parallel('scripts', 'styles', 'favicon', 'icons'),
));
// ------------------------------------------------------------------------------------------
// TASK: serve
// ------------------------------------------------------------------------------------------
gulp.task('serve', gulp.series('default', gulp.parallel('php-server', 'browsersync', 'watch')));
// ------------------------------------------------------------------------------------------
// GIT HOOKS (defined in package.json)
// ------------------------------------------------------------------------------------------
gulp.task('pre-commit', gulp.series('lint', 'test'));