有没有办法将单个 .ts 文件编译到不同的目录?
从手动命令编译到不同目录的唯一方法是通过 --out
命令,但它也会连接依赖文件,这是我不想要的:
--out FILE|DIRECTORY Concatenate and emit output to single file | Redirect output structure to the directory
有没有办法在不连接输入文件的情况下重定向输出?
最佳答案
不幸的是,如果不连接,就不可能将多个 *.ts
文件编译成一个 *.js
。因为在 API 级别的 typescript 编译选项上是不可能的。
参见--out
选项:
DEPRECATED. Use --outFile instead.
--outFile
选项的文档:
Concatenate and emit output to single file. The order of concatenation is determined by the list of files passed to the compiler on the command line along with triple-slash references and imports. See output file order documentation for more details.
关于javascript - TypeScript 通过 tsc 命令 : Output to single file without concatenation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17243897/