-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathgulpfile.mjs
47 lines (37 loc) · 1.04 KB
/
gulpfile.mjs
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
import gulp from 'gulp';
import gulpDartSass from 'gulp-dart-sass';
import del from 'del';
// side-effectful import
import 'sass';
const { src, dest, parallel, series, watch: gulpWatch } = gulp;
const { sync, logError } = gulpDartSass;
const build = (file) => () =>
src(file)
.pipe(
sync({
outputStyle: 'compressed',
sourceMap: true,
}).on('error', logError),
)
.pipe(dest('./site/_styles'));
export function style() {
return build('./site/_includes/styles/style.scss')();
}
export function print() {
return build('./site/_includes/styles/print.scss')();
}
export function fonts() {
return build('./site/_includes/styles/fonts.scss')();
}
export function clean() {
return del([
'./site/_includes/styles/style.css',
'./site/_includes/styles/fonts.css',
'./site/_includes/styles/print.css',
]);
}
export const all = parallel(style, fonts, print);
export function watch() {
gulpWatch('./site/_includes/styles/**/*.scss', all);
}
export default series(clean, all);