Currently, I am delving into the TypeScript compiler API. In order to initialize a program, I need to provide a CompilerOptions
object. My goal is to utilize the CompilerOptions
specific to a particular tsconfig.json
file, but I am struggling to determine the correct approach for this.
I have come across mentions of using parseJsonConfigFileContent
, however, this also requires a ParseConfigHost
. According to sources, it is apparently simple to implement on your own, although the method readDirectory
seems rather complex to tackle independently. From what I can gather, one must retrieve all TypeScript files within a specified directory while taking into consideration both excludes
and includes
.
It stands to reason that TypeScript likely handles this internally already. How can I leverage the default functionality of readDirectory
or ParseConfigHost
?
To rephrase: what would be the most straightforward method to acquire the CompilerOptions
tailored to a particular TypeScript project?