-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
73 lines (66 loc) · 1.83 KB
/
gulpfile.js
File metadata and controls
73 lines (66 loc) · 1.83 KB
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
import config from './gulpconfig.js';
import gulp from 'gulp';
import assets from './tasks/assets.js';
import browsersync from './tasks/browsersync.js';
import {clean} from './tasks/utility.js';
import scripts, {scriptsDefault, scriptsAdmin} from './tasks/scripts.js';
import setup from './tasks/setup.js';
import styles from './tasks/styles.js';
import templates from './tasks/templates.js';
function configHasSrc(config, src) {
return Object.prototype.hasOwnProperty.call(config, src);
}
export {
assets,
scripts,
setup,
styles,
templates,
};
export const build = gulp.series(
clean,
gulp.parallel(assets, scripts, styles, templates),
);
export const watch = gulp.parallel(
browsersync,
function monitorFiles() {
gulp.watch(
[
configHasSrc(config.assets, 'src') ?
config.assets.src : [],
configHasSrc(config.assets, 'blocksSrc') ?
config.assets.blocksSrc : [],
],
assets
);
scriptsDefault();
gulp.watch(
[
configHasSrc(config.scripts, 'adminSrc') ?
config.scripts.adminSrc : [],
],
scriptsAdmin
);
gulp.watch(
[
configHasSrc(config.styles, 'src') ?
config.styles.src : [],
configHasSrc(config.styles, 'adminSrc') ?
config.styles.adminSrc : [],
configHasSrc(config.styles, 'blocksSrc') ?
config.styles.blocksSrc : [],
],
styles
);
gulp.watch(
[
configHasSrc(config.templates, 'src') ?
config.templates.src : [],
configHasSrc(config.templates, 'blocksSrc') ?
config.templates.blocksSrc : [],
],
templates
);
},
);
export default build;