forked from radiant-persimmons/mockr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGulpfile.js
157 lines (126 loc) · 3.35 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
;(function() {
'use strict';
/* Dependencies */
var lib = require('./lib')
var gulp = require('gulp');
var $ = require('gulp-load-plugins')({lazy:true});
var del = require('del');
/* Tasks */
var tasks = lib.tasks
// ================= DEFAULT
gulp
.task('default', $.sequence('dev'));
//================== DEV
gulp
.task( 'dev',
$.sequence( 'clean'
, 'build:dev'
, 'start:dev'
));
// ====== BUILD
gulp
.task( 'js:dev' , tasks.js.dev )
.task( 'css:dev' , tasks.css.dev )
.task( 'styl:dev' , tasks.styl.dev )
.task( 'html:dev' , tasks.html.dev )
.task( 'jade:dev' , tasks.jade.dev )
.task( 'images:dev', tasks.images.dev )
.task( 'build:dev' ,
$.sequence( 'js:dev'
, 'css:dev'
, 'styl:dev'
, 'html:dev'
, 'jade:dev'
, 'images:dev'
));
// ====== START
gulp
.task( 'vendor:dev' , tasks.vendor.dev )
.task( 'inject:dev' , tasks.inject.dev )
.task( 'server:dev' , tasks.server.dev )
.task( 'watch:dev' , tasks.watch.dev )
.task( 'start:dev' ,
$.sequence(
'vendor:dev'
, 'inject:dev'
, 'server:dev'
, 'watch:dev'
));
// //================== STAGE
gulp
.task('stage',
$.sequence('clean',
'build:stage',
'start:stage'));
// ====== BUILD
gulp
.task('js:stage', tasks.js.stage)
.task('css:stage', tasks.css.stage)
.task('styl:stage', tasks.styl.stage)
.task('html:stage', tasks.html.stage)
.task('jade:stage', tasks.jade.stage)
.task('images:stage', tasks.images.stage)
.task('build:stage',
$.sequence('js:stage',
'css:stage',
'styl:stage',
'html:stage',
'jade:stage',
'images:stage'));
// ====== START
gulp
.task('vendor:stage', tasks.vendor.stage)
.task('inject:stage', tasks.inject.stage)
.task('server:stage', tasks.server.stage)
.task('watch:stage', tasks.watch.stage)
.task('start:stage',
$.sequence(
'vendor:stage',
'inject:stage',
'server:stage',
'watch:stage'
));
//================== PROD
gulp
.task('prod',
$.sequence(
'clean',
'build:stage',
'vendor:stage',
'inject:stage'
)
);
//================== DEPLOY
gulp
.task('deploy', function() {
if (process.env.NODE_ENV === 'production') gulp.start('prod');
});
//================== CLEAN
gulp
.task('clean', del.bind(null, ['build']));
/******************************************************************************
* GitHub commands
*****************************************************************************/
gulp
.task('git:rebase', tasks.git.rebase)
.task('git:push', tasks.git.push)
.task('git:pr', $.sequence('lint', 'git:rebase', 'git:push'));
/******************************************************************************
* Testing suite
*****************************************************************************/
gulp
.task('lint', tasks.lint)
.task('karma', tasks.karma)
.task('mocha', tasks.mocha)
.task('test',
$.sequence('lint',
'karma',
'mocha')
);
/**
* coveralls
* =========
* Sends code coverage data to Coveralls.
*/
gulp.task('coveralls', tasks.coveralls);
})();