-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.babel.js
51 lines (46 loc) · 1.47 KB
/
gulpfile.babel.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
import {series, watch, parallel} from 'gulp';
import {pugTask} from './tasks/pug.task';
import {cssManifestTask, cssComponentsTask} from './tasks/css.task';
import {jsLibrariesTask, jsTask} from './tasks/js.task';
import {cleanTask} from './tasks/clean.task';
import {imagesTask} from './tasks/image.task';
import {spriteTask} from './tasks/sprite.task';
import {browserSyncTask} from './tasks/browser-sync.task';
import {browserSyncInstance} from './tasks/helpers/browser-sync-instance';
import {DIST_DIR, ROOT_CSS_DIR, ROOT_ICONS_DIR, ROOT_IMAGES_DIR, ROOT_TEMPLATES_DIR} from './tasks/helpers/variables';
import {publicTask} from "./tasks/public.task";
const watchTask = () => {
watch(ROOT_TEMPLATES_DIR + '**/*.pug', series(pugTask));
watch(ROOT_TEMPLATES_DIR + '**/*.js', series(jsTask));
watch(ROOT_IMAGES_DIR + '**/*.*', series(imagesTask));
watch(ROOT_CSS_DIR + '**/*.css', series(cssManifestTask));
watch(ROOT_TEMPLATES_DIR + '**/*.css', series(cssComponentsTask));
watch(ROOT_ICONS_DIR + '**/*.*', series(spriteTask, pugTask));
watch(DIST_DIR + '**/*.*').on('change', browserSyncInstance.reload);
};
export const build = series(
cleanTask,
pugTask,
publicTask,
cssManifestTask,
cssComponentsTask,
jsTask,
jsLibrariesTask,
imagesTask,
spriteTask
);
export default series(
cleanTask,
pugTask,
publicTask,
cssManifestTask,
cssComponentsTask,
jsTask,
jsLibrariesTask,
imagesTask,
spriteTask,
parallel(
browserSyncTask,
watchTask
)
);