-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
57 lines (50 loc) · 1.82 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
// Импорт модуля GULP
import gulp from "gulp";
// Импорт путей
import { path } from "./gulp/config/path.js";
// Импорт плагинов
import { plugins } from "./gulp/config/plugins.js";
// Глобальная переменная
global.app = {
isBuild: process.argv.includes("--build"),
isDev: !process.argv.includes("--build"),
path: path,
gulp: gulp,
plugins: plugins,
};
// Импорт задач
import { copyFiles, copyFavicons ,copyIcons } from "./gulp/tasks/copy.js";
import { reset } from "./gulp/tasks/reset.js";
import { html } from "./gulp/tasks/html.js";
import { server } from "./gulp/tasks/server.js";
import { mergeStyles } from "./gulp/tasks/mergeStyles.js";
// import { tailwind } from "./gulp/tasks/tailwindcss.js";
import { js } from "./gulp/tasks/js.js";
import { images } from "./gulp/tasks/images.js";
// import {otfToTtf, ttfToWoff, fontsStyle} from "./gulp/tasks/fonts.js";
import { zip } from "./gulp/tasks/zip.js";
// Наблюдатель за изменением в файлах
const watcher = () => {
// gulp.watch(path.watch.files, copyFiles);
gulp.watch(path.watch.html, gulp.parallel(html, mergeStyles));
gulp.watch(path.watch.scss, mergeStyles);
gulp.watch(path.watch.js, gulp.parallel(js, mergeStyles));
gulp.watch(path.watch.images, images);
};
const mainTasks = gulp.parallel(
copyFavicons,
copyIcons,
copyFiles,
html,
js,
mergeStyles,
images
);
// Построение сценариев выполнения задач
const test = gulp.series(reset, mainTasks);
const dev = gulp.series(reset, mainTasks, gulp.parallel(watcher, server));
const build = gulp.series(reset, mainTasks);
const deployZIP = gulp.series(reset, mainTasks, zip);
export { dev, build, deployZIP, test };
// Выполнение сценариев
gulp.task("default", dev);