ivogabe / gulp-typescript

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

Function for the Project type which return an array of filenames #594

Closed opuzakov closed 5 years ago

opuzakov commented 6 years ago

Hello guys. I didn't find any function for the Project type, which return an array of filenames. I want to use this function for the incremental compilation. Is it possible to add this?

ivogabe commented 6 years ago

You could do that with an event listener on the stream:

tsProject.src()
  .on('data', (file) => console.log(file.path))
  .pipe(tsProject())
  .pipe(...)

This code will log all file paths to the console. Instead you could push them to an array.

As you plan to use this for incremental compilation, I want to warn you that you could get strange behavior, as the TypeScript compiler needs all files for type information. isolatedModules might be a simpler and better alternative.

opuzakov commented 5 years ago

Thank you for the information