You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 5, 2022. It is now read-only.
I would like my gulp task to fail if there were TypeScript compilation errors. I couldn't find a way to do this. If it's not already supported, could you consider adding an option for it?
The text was updated successfully, but these errors were encountered:
I see; thanks for the help. However, in the usage example, you create the compiler outside of the gulp task:
var tsb = require('gulp-tsb');
// create and keep compiler
var compilation = tsb.create({
target: 'es5',
module: 'commonjs',
declaration: false
});
gulp.task('build', function() {
return gulp.src('src/**/*.ts')
.pipe(compilation()) // <- new compilation
.pipe(gulp.dest(''));
});
This means we don't have access to the gulp task's callback, which is what we need to invoke in order to make the task fail. Could it be possible to have the IncrementalCompiler take the error callback as argument instead of the create function? Then we can do something like:
gulp.task('build', function(gulpCb) {
return gulp.src('src/**/*.ts')
.pipe(compilation(gulpCb)) // <- Pass the gulp callback (or any other error handler) directly to the compilation
.pipe(gulp.dest(''));
});
Otherwise, we need to recreate the compiler inside the gulp task every time we run the task:
I would like my gulp task to fail if there were TypeScript compilation errors. I couldn't find a way to do this. If it's not already supported, could you consider adding an option for it?
The text was updated successfully, but these errors were encountered: