-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
35 lines (27 loc) · 859 Bytes
/
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
/// <binding ProjectOpened='default' />
//
const { watch, src, dest } = require("gulp");
var config = require("./paths.json");
function copy(path, baseFolder, targets) {
targets.forEach(target => {
console.log("copy: \x1b[36m%s\x1b[0m %s", path, target);
src(path, { base: baseFolder }).pipe(dest(target));
});
}
function watchAppPlugins() {
console.log()
console.log("Watching : " + config.source);
config.sites.forEach(dest => {
console.log("Target : " + dest);
});
watch(config.source, { ignoreInitial: false })
.on("change", function (path, stats) {
copy(path, config.source, config.sites)
})
.on("add", function (path, stats) {
copy(path, config.source, config.sites)
});
}
exports.default = function () {
watchAppPlugins();
};