about summary refs log tree commit diff stats
path: root/gulpfile.js
diff options
context:
space:
mode:
Diffstat (limited to 'gulpfile.js')
-rw-r--r--gulpfile.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/gulpfile.js b/gulpfile.js
index ba113ad..e98d011 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -7,6 +7,9 @@ const rename = require('gulp-rename');
 const uglify = require('gulp-uglify-es').default;
 const touch = require('gulp-touch-fd');
 
+const ts = require("gulp-typescript");
+const tsProject = ts.createProject("tsconfig.json");
+
 function swallowError(error) {
 	console.log(error.toString())
 
@@ -35,12 +38,15 @@ gulp.task('minifyLibsJS', function(cb) {
 });
 
 gulp.task('minifyJS', function(cb) {
-	gulp
-		.src(['js/*.js'])
+	tsProject
+		.src()
+		.pipe(tsProject())
+		.on('error', swallowError)
+		.js
+		.pipe(gulp.dest("dist"))
 		.pipe(concat('app.min.js'))
 		.pipe(uglify())
 		.on('error', swallowError)
-		.pipe(gulp.dest('dist/'));
 
 		cb();
 });
@@ -73,7 +79,7 @@ gulp.task(
 		gulp.series(['minifyCSS', 'minifyJS', 'minifyLibsJS'])();
 
 		gulp.watch(['lib/**/*.js', 'lib/*.js', 'node_modules/**/.js'], gulp.series('minifyLibsJS'));
-		gulp.watch(['js/*.js'], gulp.series('minifyJS'));
+		gulp.watch(['src/*.ts'], gulp.series('minifyJS'));
 		gulp.watch(['css/*.less'], gulp.series('minifyCSS'));
 
     cb();