-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.js
92 lines (74 loc) · 2.88 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
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
// parallel() to run them at concurrency
// watch() to watches changes to files and executes the task when a change occurs
const { parallel, watch } = require("gulp");
// plugin for webserver & LiveReload
const connect = require("gulp-connect");
// tasks
const { templateHtml } = require("./gulp/tasks/templateHtml");
const { globalHtmlPages } = require("./gulp/tasks/globalHtmlPages");
const { templateMainCss } = require("./gulp/tasks/templateMainCss");
const { templateCssLibraries } = require("./gulp/tasks/templateCssLibraries");
const { templateMainScript } = require("./gulp/tasks/templateMainScript");
const { templateJsPlugins } = require("./gulp/tasks/templateJsPlugins");
const { templateImgs } = require("./gulp/tasks/templateImgs");
const { templateAssets } = require("./gulp/tasks/templateAssets");
const { templateNpmAssets } = require("./gulp/tasks/templateNpmAssets");
const { fontAwesomeFonts } = require("./gulp/tasks/fontAwesomeFonts");
const { phpFiles } = require("./gulp/tasks/phpFiles");
const { cleanup } = require("./gulp/tasks/cleanup");
const { zipper } = require("./gulp/tasks/zipper");
const { build } = require("./gulp/tasks/build");
const { themeforest_build } = require("./gulp/tasks/build");
// utils functions
const { watchTasks } = require("./gulp/utils/watchTasks");
const { generateTasksObject } = require("./gulp/utils/generateTasksObject");
// watcher task
const watcher = (cb) => {
connect.server({
root: "./dist/",
livereload: true,
});
// template html task
watchTasks(templateHtml);
// global html pages task
watchTasks(globalHtmlPages);
// template main css task
watchTasks(templateMainCss);
// template css libraries task
watchTasks(templateCssLibraries);
// template main script task
watchTasks(templateMainScript);
// template js plugins task
watchTasks(templateJsPlugins);
// template images task
watchTasks(templateImgs);
// template main assets task
watchTasks(templateAssets);
// template npm assets task
watchTasks(templateNpmAssets);
// template font-awesome fonts task
watchTasks(fontAwesomeFonts);
// php global files task
watch("src/*.php", phpFiles);
cb();
};
// export public tasks to be run by the gulp command
module.exports = {
...generateTasksObject(templateHtml),
...generateTasksObject(globalHtmlPages),
...generateTasksObject(templateMainCss),
...generateTasksObject(templateCssLibraries),
...generateTasksObject(templateMainScript),
...generateTasksObject(templateJsPlugins),
...generateTasksObject(templateImgs),
...generateTasksObject(templateAssets),
...generateTasksObject(templateNpmAssets),
...generateTasksObject(fontAwesomeFonts),
phpFiles,
cleanup,
zipper,
build,
themeforest_build,
// default task
default: parallel(watcher),
};