microsoft / microsoft/TypeScript

Add ability to get emit output from the API

未关闭
#63,851 0 条评论 2 个 reaction 已指派 1 人 已被 @andrewbranch 认领 在 GitHub 查看
Needs Investigation
主要语言
Go
星标
111k
派生
14.3k
平均合并
2 天 4 小时
30 天内合并 PR
132

描述

Our internal tool uses the TypeScript compiler to generate JS output from TS. While there are other solutions that perform TS->JS transpilation, since we already use the TS API we would like to also get the JS output from it (as well as declarations and source maps). In the Strada API this was possible using `program.emit`.

Possible solution: Add back the `program.emit` method. Instead of accepting a write-file callback (which would incur IPC overhead per file when called from Go), return the output files as an array in the response. The method should also accept an array of files so that multiple files can be emitted in a single round-trip.

Limitation: This approach currently would not allow us to get the tsbuildinfo file with the per file variant. Then again the API currently does not seem to use incremental programs anyway.

Related: microsoft/TypeScript#63843 similar, but only mentions declaration files.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。