-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
43 lines (34 loc) · 1.05 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('styles', () => {
return gulp.src('scss/front.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('block-styles', () => {
return gulp.src('scss/block-styles.scss')
.pipe(sass({
outputStyle: 'compressed'
}).on('error', sass.logError))
.pipe(gulp.dest('inc/css/'))
});
gulp.task('clean', () => {
return deleteAsync([
'inc/css/front.css',
'inc/css/block-styles.css',
]);
});
gulp.task('watch', () => {
gulp.watch('scss/*.scss', (done) => {
gulp.series(['clean', 'styles', 'block-styles'])(done);
});
});
gulp.task('default', gulp.series(['clean', 'styles', 'block-styles', 'watch']));