forked from freahs/node-red-contrib-node-tradfri
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
37 lines (31 loc) · 955 Bytes
/
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
var gulp = require('gulp');
var del = require('del');
var shell = require('gulp-shell');
var ts = require('gulp-typescript');
gulp.task('clean:build', () => {
return del(['./build/**']);
});
gulp.task('compile', gulp.series('clean:build', () => {
let numErrors = 0;
let res = gulp.src('src/**/*.ts')
.pipe(
ts({
module: 'commonjs',
target: 'es2015',
declaration: true
})
)
.on('error', () => {
numErrors += 1;
})
return res.pipe(gulp.dest('build'))
}));
gulp.task('install', gulp.series('compile', () => {
return gulp.src(['src/*.html', 'build/*.js'])
.pipe(gulp.dest('dist'));
}));
gulp.task('exec', gulp.series('install', shell.task('docker restart node-red')));
gulp.task('watch', function() {
return gulp.watch(['src/*.html', 'src/*.ts'], ['exec']);
});
gulp.task('default', gulp.series('install'));