-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
36 lines (31 loc) · 1.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
36
const gulp = require('gulp');
const ts = require('gulp-typescript');
const concat = require('gulp-concat');
const sass = require('gulp-sass')(require('sass'))
const tsProject = ts.createProject('tsconfig.json');
gulp.task('clear', async function () {
const del = (await import('del')).deleteAsync
return del('dist/**', { force: true });
});
gulp.task('html', function () {
return gulp.src('src/**/*.html')
.pipe(gulp.dest('dist'))
})
gulp.task('sass', function () {
return gulp.src('src/**/*.sass')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('dist'))
})
gulp.task('compile-ts', function () {
return gulp.src('src/**/*.ts')
.pipe(tsProject())
.pipe(gulp.dest('dist'))
})
gulp.task('watch', function () {
gulp.watch('src/**/*.html', gulp.series('html'));
gulp.watch('src/**/*.sass', gulp.series('sass'));
gulp.watch('src/**/*.ts', gulp.series('compile-ts'));
})
gulp.task('default', gulp.series('compile-ts', 'watch'));
exports.build = gulp.series('clear','html','sass','compile-ts')
exports.dev = gulp.series('clear', 'html','sass','compile-ts', 'watch')