Closed SET001 closed 4 years ago
From the docs:
tsify supports overriding the
files
,exclude
andinclude
options. In particular, if"files": []
is specified, only the Browserify entry points (and their dependencies) are passed to TypeScript for compilation.
So this should work:
task('compile', () =>
browserify()
.add('./src/index.ts')
.plugin(tsify, { noImplicitAny: true, files: [] })
.bundle()
.on('error', errorHandler)
.pipe(dest('./dist'))
But I don't use Gulp, I've not used tsify for a long time and I've always used tsify in conjunction with a tsconfig.json
file. Regarding the latter, I would not recommend using it without a tsconfig.json
file, as there are too many compiler options and the defaults are not sensible - not strict
, etc.
yeah, that works fine. Thanx.
following the example on readme I created such a gulp task that should compile my
index.ts
however, for some reason. I'm getting errors from other files which are not included in
index.tx
. Seems like tsify is compiling all *.ts files. How can I stop it from doing that? How can I make it to compile only index.ts and all files that are imported from there?