-
Notifications
You must be signed in to change notification settings - Fork 68
/
gulpfile.js
117 lines (93 loc) · 3.78 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/* eslint
no-var: 0,
no-multi-spaces: 0,
no-mixed-spaces-and-tabs: 0,
no-multiple-empty-lines: 0
*/
var gulp = require('gulp');
var gutil = require('gulp-util');
// utils
var validateConfig = require('./gulp/core/utils/validateConfig');
var lazyQuire = require('./gulp/core/utils/lazyQuire');
// config
var project = require('./project.config');
// validate the project
// configuration
validateConfig(project);
// gulpfile booting message
gutil.log(gutil.colors.green('Starting to Gulp! Please wait...'));
/**
* Grouped
*/
gulp.task('default', [
'fonts:watch',
'svg:watch',
'sprite:watch',
'images:watch',
'scripts:watch',
'styles:watch',
'theme:watch',
'browser:sync'
]);
gulp.task('build', [
'fonts:prod',
'svg:prod',
'sprite:prod',
'images:prod',
'scripts:prod',
'styles:prod',
'theme:prod'
]);
/**
* Browser
*/
gulp.task('browser:sync', [], lazyQuire(require, './gulp/core/recipes/browser-sync'));
/**
* Fonts
*/
gulp.task('fonts:clean', [], lazyQuire(require, './gulp/core/recipes/fonts/clean'));
gulp.task('fonts:dev', ['fonts:clean'], lazyQuire(require, './gulp/core/recipes/fonts/dev'));
gulp.task('fonts:prod', ['fonts:clean'], lazyQuire(require, './gulp/core/recipes/fonts/prod'));
gulp.task('fonts:watch', ['fonts:dev'], lazyQuire(require, './gulp/core/recipes/fonts/watch'));
/**
* Svgs
*/
gulp.task('svg:clean', [], lazyQuire(require, './gulp/core/recipes/svg/clean'));
gulp.task('svg:dev', ['svg:clean'], lazyQuire(require, './gulp/core/recipes/svg/dev'));
gulp.task('svg:prod', ['svg:clean'], lazyQuire(require, './gulp/core/recipes/svg/prod'));
gulp.task('svg:watch', ['svg:dev'], lazyQuire(require, './gulp/core/recipes/svg/watch'));
/**
* Svg Sprites
*/
gulp.task('sprite:clean', [], lazyQuire(require, './gulp/core/recipes/sprite/clean'));
gulp.task('sprite:dev', ['sprite:clean'], lazyQuire(require, './gulp/core/recipes/sprite/dev'));
gulp.task('sprite:prod', ['sprite:clean'], lazyQuire(require, './gulp/core/recipes/sprite/prod'));
gulp.task('sprite:watch', ['sprite:dev'], lazyQuire(require, './gulp/core/recipes/sprite/watch'));
/**
* Images
*/
gulp.task('images:clean', [], lazyQuire(require, './gulp/core/recipes/images/clean'));
gulp.task('images:dev', ['images:clean'], lazyQuire(require, './gulp/core/recipes/images/dev'));
gulp.task('images:prod', ['images:clean'], lazyQuire(require, './gulp/core/recipes/images/prod'));
gulp.task('images:watch', ['images:dev'], lazyQuire(require, './gulp/core/recipes/images/watch'));
/**
* Scripts
*/
gulp.task('scripts:clean', [], lazyQuire(require, './gulp/core/recipes/scripts/clean'));
gulp.task('scripts:dev', ['scripts:clean'], lazyQuire(require, './gulp/core/recipes/scripts/dev'));
gulp.task('scripts:prod', ['scripts:clean'], lazyQuire(require, './gulp/core/recipes/scripts/prod'));
gulp.task('scripts:watch', ['scripts:clean'], lazyQuire(require, './gulp/core/recipes/scripts/watch'));
/**
* Styles
*/
gulp.task('styles:clean', [], lazyQuire(require, './gulp/core/recipes/styles/clean'));
gulp.task('styles:dev', ['styles:clean'], lazyQuire(require, './gulp/core/recipes/styles/dev'));
gulp.task('styles:prod', ['styles:clean'], lazyQuire(require, './gulp/core/recipes/styles/prod'));
gulp.task('styles:watch', ['styles:dev'], lazyQuire(require, './gulp/core/recipes/styles/watch'));
/**
* Theme
*/
gulp.task('theme:clean', [], lazyQuire(require, './gulp/core/recipes/theme/clean'));
gulp.task('theme:dev', ['theme:clean'], lazyQuire(require, './gulp/core/recipes/theme/dev'));
gulp.task('theme:prod', ['theme:clean'], lazyQuire(require, './gulp/core/recipes/theme/prod'));
gulp.task('theme:watch', ['theme:dev'], lazyQuire(require, './gulp/core/recipes/theme/watch'));