gulp-typescript
gulp-typescript copied to clipboard
The docs are outdated
Hey,
The example in the documentation may not be compatible with Gulp 5 and the merge2
package. It should be replaced with merge-stream
instead. The merge2
package only works with Gulp 4. With Gulp 5, the merge2
package throws the following error Error: Writable stream closed prematurely
while running this example:
gulp.task('scripts', function() {
var tsResult = gulp.src('lib/**/*.ts')
.pipe(ts({
declaration: true
}));
return merge([
tsResult.dts.pipe(gulp.dest('release/definitions')),
tsResult.js.pipe(gulp.dest('release/js'))
]);
});
This might be confusing for some developers since most of us run npm install gulp
, which installs the latest version by default. Hope this helps!