- Learn React with TypeScript 3
- Carl Rippon
- 132字
- 2021-06-10 19:16:39
tsconfig.json
As we have seen, there are lots of different switches that we can apply to the compilation process, and repeatedly specifying these on the command line is a little clunky. Luckily, we can specify these options in a file called tsconfig.json. The compiler options we have looked at in previous sections are defined in a compilerOptions field without the "--" prefix.
Let's take a look at an example:
- Let's create a tsconfig.json file with the following content:
{
"compilerOptions": {
"target": "esnext",
"outDir": "dist",
"module": "es6",
"moduleResolution": "node",
"sourceMap": true,
"noImplicitReturns": true,
"noImplicitAny": true
}
}
- Let's run a compile without specifying the source file and any flags:
tsc
The compilation will run fine, with the transpiled JavaScript being output to the dist folder along with a source map file.
推薦閱讀
- Getting Started with ResearchKit
- SQL學(xué)習(xí)指南(第3版)
- 程序員面試算法寶典
- Android 9 Development Cookbook(Third Edition)
- Web開(kāi)發(fā)的貴族:ASP.NET 3.5+SQL Server 2008
- Learning Elixir
- Python計(jì)算機(jī)視覺(jué)編程
- Java程序員面試算法寶典
- Access 2010數(shù)據(jù)庫(kù)基礎(chǔ)與應(yīng)用項(xiàng)目式教程(第3版)
- PostgreSQL 11從入門(mén)到精通(視頻教學(xué)版)
- 編譯系統(tǒng)透視:圖解編譯原理
- Java編程技術(shù)與項(xiàng)目實(shí)戰(zhàn)(第2版)
- Mastering Ext JS
- 名師講壇:Spring實(shí)戰(zhàn)開(kāi)發(fā)(Redis+SpringDataJPA+SpringMVC+SpringSecurity)
- Practical GIS