-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
84 lines (76 loc) · 1.72 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
const gulp = require('gulp'),
clean = require('gulp-clean'),
concatCss = require('gulp-concat-css'),
rename = require('gulp-rename'),
uglifycss = require('gulp-uglifycss'),
wpPot = require("gulp-wp-pot"),
sort = require("gulp-sort");
gulp.task('watch', () => {
gulp.watch(['assets/css/**/*.css']).on(
'change',
gulp.series(
'clean-shared',
'clean-blocks',
'minify-shared',
'minify-blocks'
)
);
});
gulp.task('clean-shared', () => {
return gulp.src('assets/css/style-shared.min.css', {
read: false,
allowEmpty: true,
})
.pipe(clean());
});
gulp.task('clean-blocks', () => {
return gulp.src('assets/css/blocks/*.min.css', {
read: false,
allowEmpty: true,
})
.pipe(clean());
});
gulp.task('concat-shared', () => {
return gulp.src('assets/css/style-shared/*.css')
.pipe(concatCss('style-shared.css'))
.pipe(gulp.dest('assets/css/'));
});
gulp.task('minify-shared', () => {
return gulp.src('assets/css/style-shared.css')
.pipe(concatCss('style-shared.min.css'))
.pipe(uglifycss())
.pipe(gulp.dest('assets/css/'));
});
gulp.task('minify-blocks', () => {
return gulp.src('assets/css/blocks/*.css')
.pipe(uglifycss())
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('assets/css/blocks'));
});
gulp.task('translate', () => {
return gulp
.src("./**/*.php")
.pipe(sort())
.pipe(
wpPot({
domain: "blockette",
package: "Blockette",
bugReport: "https://micemade.com/contact/",
lastTranslator: "Alen Sirola <[email protected]>",
team: "Micemade <[email protected]>",
})
)
.pipe(
gulp.dest("./languages/blockette.pot")
)
});
gulp.task(
'default',
gulp.series(
'clean-shared',
'clean-blocks',
'concat-shared',
'minify-shared',
'minify-blocks'
)
);