-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathgulpfile.js
58 lines (51 loc) · 1.23 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
'use strict';
/*!
* V4Fire Core
* https://github.com/V4Fire/Core
*
* Released under the MIT license
* https://github.com/V4Fire/Core/blob/master/LICENSE
*/
require('@config/config');
/**
* Initializes the specified gulp instance.
* This helper brings a feature to extends one gulp config from another.
*
* @param gulp - link to the gulp module
*
* @example
* ```js
* require('@config/config');
*
* module.exports = function (gulp = require('gulp')) {
* // Include the parent config
* include('@super/gulpfile', __dirname)(gulp);
*
* // Register own tasks
* include('build/my-extra-gulp-tasks')(gulp);
*
* // Call the special method to initialize registered tasks
* global.callGulp(module);
* };
*
* module.exports();
* ```
*/
module.exports = function initGulp(gulp = require('gulp')) {
/**
* The global helper to initialize gulp tasks
*/
globalThis.callGulp = (module) => {
if (/gulp-cli/.test(module.parent.id)) {
gulp.init();
}
};
const {wrapGulp} = include('build/wrap.gulp');
wrapGulp(gulp);
include('build/tsconfig.gulp')(gulp);
include('build/build.gulp')(gulp);
include('build/doc.gulp')(gulp);
include('build/other.gulp')(gulp);
globalThis.callGulp(module);
};
module.exports();