javascript - TypeScript 通过 tsc 命令 : Output to single file without concatenation

标签 javascript typescript bundle tsc transpiler

有没有办法将单个 .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.

全部typescript compiler options

关于javascript - TypeScript 通过 tsc 命令 : Output to single file without concatenation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17243897/

相关文章:

swift - 运行 XCTests 时访问主应用程序包

javascript - d3 中的短路事件?

javascript - 如何在不使用索引器(javascript)的情况下访问数组的元素?

javascript - Angular DI 和继承 : injecting extensions of a base service

typescript 项目引用和 JavaScript 文件

ruby-on-rails - 如何将 Rails 打包为独立的可执行文件

javascript - JSGrid 以编程方式选择第一行

javascript - 如何测试 Three.js 中光线拾取的错误?

node.js - 是什么阻止我的 AngularJs 2 应用程序运行检查器中显示的命令?

mysql - 无法在/usr/local/bin/mysql_config执行mysql_config