This lesson walks you through creating your first .tsconfig configuration file which will tell the TypeScript compiler how to treat your .ts files.
Init a config.json file:
tsc --init
tsconfig.json, will be created:
{ "compilerOptions": { "module": "commonjs", "target": "es5", "noImplicitAny": false, "sourceMap": false }, "exclude": [ "node_modules" ] }
Previously, we nee to say:
tsc app.ts
to compile file, now, we don‘t need to do that, it will find ts files and compile when you run ‘tsc‘. notice, node_modules is excluded by default.
时间: 2024-12-25 10:34:13