-
Notifications
You must be signed in to change notification settings - Fork 17
/
gulpfile.js
34 lines (29 loc) · 1.02 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
"use strict";
const alphabetical = require("css-declaration-sorter"),
autoprefixer = require('gulp-autoprefixer'),
browserSync = require("browser-sync").create(),
concat = require("gulp-concat"),
sourcemaps = require("gulp-sourcemaps"),
gulp = require("gulp"),
postcss = require("gulp-postcss"),
sass = require("gulp-sass")
gulp.task("browserSync", () => {
browserSync.init({
server: "./"
})
})
gulp.task("sass", () => {
return gulp.src("turkuaz.scss")
.pipe(sourcemaps.init())
.pipe(sass({outputStyle: "compressed"}).on("error", sass.logError))
.pipe(concat("turkuaz.min.css"))
.pipe(postcss([alphabetical({order: "alphabetically"})]))
.pipe(autoprefixer())
.pipe(sourcemaps.write("./"))
.pipe(gulp.dest("css"))
.pipe(browserSync.stream())
})
gulp.task("watch", function() {
gulp.watch("scss/**/*.scss", gulp.series("sass"))
})
gulp.task("default", gulp.parallel("sass", "watch", "browserSync"))