# tsc CLI 选项

# 使用命令行界面

在本地运行 tsc将编译由 tsconfig.json定义的最接近的项目,您可以通过传入一个您想要的文件来编译一组 TypeScript 文件。

### Run a compile based on a backwards look through the fs for a tsconfig.json
tsc

### Emit JS for just the index.ts with the compiler defaults
tsc index.ts

### Emit JS for any .ts files in the folder src, with the default settings
tsc src/*.ts

### Emit files referenced in with the compiler settings from tsconfig.production.json
tsc --project tsconfig.production.json

### Emit d.ts files for a js file with showing compiler options which are booleans
tsc index.js --declaration --emitDeclarationOnly

### Emit a single .js file from two files via compiler options which take string arguments
tsc app.ts util.ts --target esnext --outfile index.js

# 编译器选项

如果您正在寻找有关 tsconfig 中编译器选项的更多信息,请查看 TSConfig 参考手册

# CLI 命令

+

关注公众号,获取验证码 !

验证码:
Last Updated: 5/5/2023, 8:48:21 AM