-
Notifications
You must be signed in to change notification settings - Fork 22
/
index.js
41 lines (32 loc) · 1.26 KB
/
index.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
const _ = require('lodash');
const defaultConfig = require('./config.default');
module.exports = (gulp, userConfig, tasks) => {
const config = _.merge(defaultConfig, userConfig);
/* eslint-disable global-require */
if (config.browserSync.enabled) {
require('./lib/browser-sync')(gulp, config, tasks);
}
if (config.icons.enabled) {
require('./lib/icons')(gulp, config, tasks);
}
if (config.js.enabled) {
require('./lib/js')(gulp, config, tasks);
}
if (config.css.enabled) {
require('./lib/css')(gulp, config, tasks);
}
if (config.patternLab.enabled) {
require('./lib/pattern-lab--php-twig')(gulp, config, tasks);
}
if (config.drupal.enabled) {
require('./lib/drupal')(gulp, config, tasks);
}
/* eslint-enable global-require */
// Instead of `gulp.parallel`, which is what is set in Pattern Lab Starter's `gulpfile.js`, this
// uses `gulp.series`. Needed to help with the Gulp task dependencies lost going from v3 to v4.
// We basically need icons compiled before CSS & CSS/JS compiled before inject:pl before pl
// compile. The order of the `require`s above is the order that compiles run in; not perfect, but
// it works.
// eslint-disable-next-line no-param-reassign
tasks.compile = gulp.series(tasks.compile);
};