ivogabe / gulp-typescript

A TypeScript compiler for gulp with incremental compilation support.
MIT License
822 stars 129 forks source link

Readme example says deprecated #642

Closed Extarys closed 4 years ago

Extarys commented 4 years ago

Expected behavior: Example in the README should work.

Actual behavior: Example in the README doesn't work and I cannot find how to make it work.

gulp-typescript: ts(tsProject) has been deprecated - use .pipe(tsProject()) instead
  As of gulp-typescript 3.0, .pipe(ts(tsProject)) should be written as .pipe(tsProject()).
  More information: http://dev.ivogabe.com/gulp-typescript-3/

Your gulpfile:

Include your gulpfile, or only the related task (with ts.createProject).

var { task, src, parallel, series, dest } = require('gulp');
var path = require('path');
var ts = require('gulp-typescript');
var nm = require('gulp-nodemon');
var csso = require('gulp-csso');
var sass = require('gulp-sass');
var htmlmin = require('gulp-htmlmin');
var del = require('del');

task('ts', function () {
    return src('server/**/*.ts')
        .pipe(ts({
            noImplicitAny: true,
        }))
        .pipe(dest('build'));
});

exports.builddev = parallel(ts);

I also found different "solution" none of them works:

// var tsProject = ts.createProject('tsconfig.json');
// task('ts', function () {
//     return tsProject.src()
//         .pipe(tsProject())
//         .js
//         .pipe(dest('build'));
// });

I still get the deprecation error.

Extarys commented 4 years ago

The task needs to be in ' oopsie Closing.