-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
31 lines (28 loc) · 1.2 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
const gulp = require("gulp");
const sass = require("gulp-sass");
const autoprefixer = require("gulp-autoprefixer");
const sourcemaps = require("gulp-sourcemaps");
// const concat = require("gulp-concat");
// const htmlmin = require("gulp-htmlmin");
// const terser = require("gulp-terser"); // terser == uglify
//============================================ Styles scss ======================================//
gulp.task("scss", function () {
return gulp
.src("./src/scss/*scss")
.pipe(sourcemaps.init())
.pipe(
sass({
errorLogToConsole: true,
})
)
.on("error", console.error.bind(console))
.pipe(autoprefixer(["last 5 versions", "> 1%", "ie 7"], { cascade: true }))
.pipe(sourcemaps.write("./"))
.pipe(gulp.dest("./public/css/"));
});
// ============================================ Watching files ======================================//
gulp.task("watchFiles", function () {
gulp.watch("./src/scss/**/*scss", gulp.parallel("scss"));
});
//============================================ Task "styles" & "scripts" ======================================//
gulp.task("default", gulp.parallel("scss", "watchFiles"));