-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.babel.js
43 lines (34 loc) · 894 Bytes
/
gulpfile.babel.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 { deleteSync } from "del";
import minify from "gulp-csso";
import gulpSass from "gulp-sass";
import sass2 from "sass";
import autoprefixer from "gulp-autoprefixer";
const sass = gulpSass(sass2);
const routes = {
css: {
watch: "src/scss/*",
src: "src/scss/styles.scss",
dest: "dest/css",
},
};
const styles = () =>
gulp
.src(routes.css.src)
.pipe(sass().on("error", sass.logError))
.pipe(
autoprefixer({
flexbox: true,
grid: "autoplace",
})
)
.pipe(minify())
.pipe(gulp.dest(routes.css.dest));
const watch = () => {
gulp.watch(routes.css.watch, styles);
};
const clean = async () => await deleteSync(["dest/"]);
const prepare = gulp.series([clean]);
const assets = gulp.series([styles]);
const live = gulp.parallel([watch]);
export const dev = gulp.series([prepare, assets, live]);