-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
43 lines (36 loc) · 1.11 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
import gulp from "gulp";
import dartSass from 'sass'
import gulpSass from 'gulp-sass'
const sass = gulpSass(dartSass);
import sourcemaps from 'gulp-sourcemaps';
import {deleteAsync} from 'del';
gulp.task('theme-styles', () => {
return gulp.src('sass/styles.scss')
.pipe(sourcemaps.init())
.pipe(sass({
outputStyle: 'compressed'//nested, expanded, compact, compressed
}).on('error', sass.logError))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('./css/'))
});
gulp.task('404-styles', () => {
return gulp.src('sass/404-styles.scss')
.pipe(sourcemaps.init())
.pipe(sass({
outputStyle: 'compressed'//nested, expanded, compact, compressed
}).on('error', sass.logError))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('./css/'))
});
gulp.task('clean', () => {
return deleteAsync([
'inc/css/block-style.css',
'inc/css/style.css',
]);
});
gulp.task('watch', () => {
gulp.watch('sass/*.scss', (done) => {
gulp.series(['theme-styles'])(done);
});
});
gulp.task('default', gulp.series(['theme-styles', '404-styles', 'watch']));