-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
37 lines (37 loc) · 1.01 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
36
37
"use strict";
const gulp = require("gulp");
const sass = require("gulp-sass");
const autoprefixer = require("gulp-autoprefixer");
const tsc = require("gulp-tsc");
const sassFiles = "./wwwroot/app/**/*.scss";
const tsServer = ["./*.ts", "./**/*.ts"];
gulp.task("styles", () => {
return gulp
.src(sassFiles, { base: "./" })
.pipe(sass())
.pipe(autoprefixer({ browsers: ["last 2 version", "> 5%"] }))
.pipe(gulp.dest("./"));
});
gulp.task("sass-watcher", () => {
gulp.watch([sassFiles], ["styles"]);
});
gulp.task("tsServer", () => {
return gulp
.src(tsServer)
.pipe(tsc({
module: "commonjs",
sourceMap: true,
target: "es6",
removeComments: true,
noImplicitAny: true,
moduleResolution: "node"
}))
.pipe(gulp.dest("./"));
});
gulp.task("watch-ts", () => {
gulp.watch(tsFiles, ["ts"]);
});
gulp.task("watch-all", () => {
gulp.watch(tsFiles, ["ts"]);
gulp.watch([sassFiles], ["styles"]);
});