-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
49 lines (37 loc) · 1.07 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
38
39
40
41
42
43
44
45
46
47
48
49
const gulp = require("gulp");
const ts = require('gulp-typescript');
const sass = require('gulp-sass');
// SCSS => CSS
sass.compiler = require('node-sass');
const sassTask = function () {
return gulp.src('./sass/**/*.scss')
.pipe(sass({
sourceMap: false,
outputStyle: 'compressed'
}).on('error', sass.logError))
.pipe(gulp.dest('./css'));
}
gulp.task('sass', sassTask);
const sassWatch = function () {
gulp.watch('./sass/**/*.scss', gulp.series('sass'));
}
gulp.task('sass:watch', sassWatch);
// TypeScript => JavaScript
const tsTask = function () {
return gulp.src('js/*.ts')
.pipe(ts({
target: 'es6',
module: 'system',
noImplicitAny: true
}))
.pipe(gulp.dest('js'));
}
gulp.task('tsc', tsTask);
const tscWatch = function () {
gulp.watch('./js/**/*.ts', gulp.series('tsc'));
}
gulp.task('tsc:watch', tscWatch);
// Run watch tasks
gulp.task('watch', gulp.parallel(sassWatch, tscWatch));
// Run default tasks
gulp.task('default', gulp.series(sassTask, tsTask));