-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
57 lines (51 loc) · 1.16 KB
/
gulpfile.js
File metadata and controls
57 lines (51 loc) · 1.16 KB
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
const gulp = require('gulp'),
clean = require('gulp-clean'),
concatCss = require('gulp-concat-css'),
cssnano = require('gulp-cssnano'),
rename = require('gulp-rename');
gulp.task('watch', function () {
gulp.watch(['assets/css/src/**/*.css']).on(
'change',
gulp.series(
'clean-shared',
'clean-blocks',
'minify-shared',
'minify-blocks'
)
);
});
gulp.task('clean-shared', function () {
return gulp.src('assets/css/min/style-shared.min.css', {
read: false,
allowEmpty: true,
})
.pipe(clean());
});
gulp.task('clean-blocks', function () {
return gulp.src('assets/css/min/blocks/*.min.css', {
read: false,
allowEmpty: true,
})
.pipe(clean());
});
gulp.task('minify-shared', function () {
return gulp.src('assets/css/src/*.css')
.pipe(concatCss('style-shared.min.css'))
.pipe(cssnano())
.pipe(gulp.dest('assets/css/min/'));
});
gulp.task('minify-blocks', function () {
return gulp.src('assets/css/src/blocks/*.css')
.pipe(cssnano())
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('assets/css/min/blocks/'));
});
gulp.task(
'default',
gulp.series(
'clean-shared',
'clean-blocks',
'minify-shared',
'minify-blocks'
)
);