forked from mirabeau-nl/frontend-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.babel.js
72 lines (62 loc) · 1.51 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/* eslint-disable sort-imports */
import { series, parallel } from 'gulp'
// Load tasks
import { clean } from './tasks/clean'
import { codestyle, codestyleIsValid } from './tasks/codestyle'
import { browserSync } from './tasks/browsersync'
import { html, htmlWatch, moveTemplatesToRoot } from './tasks/html'
import { img, imgWatch } from './tasks/img'
import { css, cssWatch, cssLint } from './tasks/css'
import { docs, docsWatch } from './tasks/docs'
import { fonts, fontsWatch } from './tasks/fonts'
import { js, jsLint, jsTest } from './tasks/js'
import { mock, mockWatch } from './tasks/mock'
import { fileUpload } from './tasks/upload'
import { githooks } from './tasks/githooks'
import { zip } from './tasks/zip'
function dev(cb) {
return series(
clean,
parallel(docs, html, img, css, fonts, mock),
parallel(
js,
browserSync,
docsWatch,
htmlWatch,
imgWatch,
cssWatch,
fontsWatch,
mockWatch
)
)(cb)
}
function dist(cb) {
const { argv } = process
if (argv.includes('--static')) {
return series(
clean,
parallel(html, img, css, fonts, js),
moveTemplatesToRoot
)(cb)
}
return series(clean, parallel(docs, html, img, css, fonts, mock, js), zip)(cb)
}
function codequality(cb) {
return parallel(cssLint, jsLint)(cb)
}
function test(cb) {
return series(jsTest)(cb)
}
function upload(cb) {
return series(dist, fileUpload)(cb)
}
export {
githooks,
codestyle,
codestyleIsValid,
dev,
dist,
codequality,
test,
upload
}