-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
35 lines (30 loc) · 1 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
const gulp = require("gulp");
// const replace = require("gulp-replace");
const sass = require("gulp-sass")(require("sass"));
function compileSass() {
return gulp
.src("src/**/*.scss")
// Don't catch errors, since we don't want a fixed 0 exitcode
// .pipe(sass().on("error", sass.logError))
.pipe(sass())
.pipe(gulp.dest("lib"));
}
gulp.task("css:compile", compileSass);
gulp.task("css:watch", function () {
gulp.watch("src/**/*.scss", gulp.series("css:compile"));
});
// use ts-rename-import-plugin instead of gulp
// function replaceSassImport() {
// return gulp
// .src(["lib/**/*.js"])
// .pipe(
// replace(/^import\s+(?:'|")(.+?)(?:'|")/gm, (match, p1) => {
// return match.replace(p1, p1.replace(".scss", ".css"));
// })
// )
// .pipe(gulp.dest("lib"));
// }
// gulp.task("css:replace", replaceSassImport);
// exports.css = gulp.series("css:compile", "css:replace");
exports.css = gulp.series("css:compile");
exports.watch = gulp.series("css:watch");