-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
90 lines (68 loc) · 1.92 KB
/
index.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
'use strict';
var browserSync = require('browser-sync').create(),
defaultConfig = require('./defaultConfiguration'),
_ = require('underscore');
module.exports = function(gulp, userConfig) {
var configKeys = _.keys(userConfig);
// initialize config with the single mandatory build property
var config = {
build: defaultConfig.build
};
configKeys.map(function(configKey) {
if (defaultConfig[configKey]) {
config[configKey] = _.assign(defaultConfig[configKey], userConfig[configKey]);
}
});
if (config.bower) {
require('./tasks/bower')(gulp);
}
if (config.clean) {
require('./tasks/clean')(gulp, config);
}
if (config.fonts) {
require('./tasks/fonts')(gulp, config);
}
if (config.gitDeploy) {
require('./tasks/gitDeploy')(gulp, config);
}
if (config.images) {
require('./tasks/images')(gulp, config);
}
if (config.jshint) {
require('./tasks/jshint')(gulp, config);
}
if (config.mavenDeploy) {
require('./tasks/mavenDeploy')(gulp, config);
}
if (config.mavenInstall) {
require('./tasks/mavenInstall')(gulp, config);
}
if (config.styles) {
require('./tasks/sass')(gulp, config, browserSync);
}
if (config.scripts) {
require('./tasks/scripts')(gulp, config);
}
if (config.statics) {
require('./tasks/statics')(gulp, config);
}
if (config.bowerFonts) {
require('./tasks/bowerFonts')(gulp, config);
}
if (config.bowerScripts) {
require('./tasks/bowerScripts')(gulp, config);
}
if (config.bowerStyles) {
require('./tasks/bowerStyles')(gulp, config);
}
if (config.serve) {
require('./tasks/browserSync')(gulp, config, browserSync);
require('./tasks/watch')(gulp, config, browserSync);
}
// mandatory tasks
require('./tasks/index')(gulp, config);
require('./tasks/build')(gulp, config);
require('./tasks/serve')(gulp, config);
require('./tasks/default')(gulp, config);
return config;
};