我很惊讶这不是我能找到的文档 - 但是有没有办法告诉tsc你运行目录中的所有文件及其子代而不进行整个tsconfig.json设置?
Nat*_*end 14
从来没听说过.使用tsc命令行而不tsconfig.json需要您单独指定每个文件,如下所示:
tsc MyFile1.ts MyFile2.ts MyFile3.ts
Run Code Online (Sandbox Code Playgroud)
但是,看起来您只需tsconfig.json在TypeScript目录的根目录下创建一个空,它就可以执行您想要的操作.来自https://github.com/Microsoft/TypeScript/wiki/tsconfig.json:
如果a中没有
{}属性"files",则编译器默认包含所包含目录和子目录中的所有TypeScript(*.ts或*.tsx)文件.
您可以使用全局
tsc x/file1.ts x/file2.ts x/file3.ts
Run Code Online (Sandbox Code Playgroud)
应该等于
tsc x/*.ts
Run Code Online (Sandbox Code Playgroud)
如果项目文件夹中有 tsconfig.json 文件,则可以直接键入
tsc 该命令将编译当前文件夹中的所有 ts 文件,如果您没有 tsconfig.json 文件,可以通过键入以下内容来生成它:'
tsc-init
| 归档时间: |
|
| 查看次数: |
24452 次 |
| 最近记录: |