-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
70 lines (57 loc) · 1.51 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
const { series, parallel } = require('gulp');
const clean = require('./tasks/clean');
const compress = require('./tasks/compress');
const imagemin = require('./tasks/imagemin');
const copyImages = require('./tasks/copyImages');
const copyJs = require('./tasks/copyJs');
const copyRoot = require('./tasks/copyRoot');
const iconSvg = require('./tasks/iconSvg');
const iconFont = require('./tasks/iconFont');
const spriteRetina = require('./tasks/spriteRetina');
const sprite = require('./tasks/sprite');
const twig = require('./tasks/twig');
const twig2 = require('./tasks/twig2');
const sass = require('./tasks/sass');
const webpack = require('./tasks/webpack');
const validate = require('./tasks/validate');
const watch = require('./tasks/watch');
const buildCMS = require('./tasks/buildCMS');
const build = function build(done) {
return series(clean, parallel(iconSvg, buildCMS), parallel(sass, webpack, twig, twig2, copyImages, copyJs, copyRoot))(done);
};
const dev = function dev(done) {
return series(build, watch)(done);
};
const min = function min(done) {
process.env.NODE_ENV = 'production';
return series(build, imagemin)(done);
};
const zip = function zip(done) {
return series(min, compress)(done);
};
const minwatch = function minwatch(done) {
return series(min, watch)(done);
};
module.exports = {
clean,
compress,
copyImages,
copyJs,
copyRoot,
iconSvg,
iconFont,
imagemin,
twig,
twig2,
sass,
spriteRetina,
sprite,
validate,
watch,
webpack,
default: dev,
build,
min,
export: zip,
minwatch,
};