When you install TypeScript, you get the
tsc command that invokes the TypeScript compiler. The TypeScript compiler is designed to process TypeScript program files (ending with _`.ts_
tsc command takes the file paths of these TypeScript programs as command-line arguments as well as compiler-options to customize the compilation settings using command-line flags. The command-line API of TypeScript has been explained in detail in the Compiler Flags lesson (coming soon).
We can provide this information from a configuration file
tsconfig.json as well. When you execute the
tsc command without any command-line arguments, the TypeScript compiler looks for the
tsconfig.json in the current directory. The file structure of
tsconfig.json and how TypeScript compiler searches for it is explained in detail in the Compilation lesson (coming soon).
tsconfig.json but if no value for it is provided then the output directory is the current directory.
.ts file will have its corresponding compiled
.js output file in the output directory.
In this mode, the output file has the same name as the original source file, only the extension is changed from
.js. TypeScript also likes to maintain the folder structure, therefore if a source file path is
a/b/c.ts, then the output file is emitted with the same folder structure inside the output directory such as
/dist/a/b/c.js. This is quite useful if you want to maintain the same file structure of the project in the output.
The second mode is bundled. In the bundled mode, all source
.ts files are compiled into a single
.js file. In this mode, you can give any filename you want to the output
.js bundle file. This is useful when you want to ship a project as a library that can be imported from a single
.js file in the browser (using a _`
Looking to build dynamic, extensively featured, and full-fledged web applications? **[Hire NodeJs Developer](https://hourlydeveloper.io/hire-dedicated-node-js-developer/ "Hire NodeJs Developer")** to create a real-time, faster, and scalable...
Looking to **hire NodeJS Developer**[https://www.dataeximit.com/node-js-development/](https://www.dataeximit.com/node-js-development/ "https://www.dataeximit.com/node-js-development/") to build a perfect back-end to your website or...
With the rapid development in technology, the old ways to do business have changed completely. A lot more advanced and developed ways are ...
You name the business and I will tell you how web development can help you promote your business. If it is a startup or you seeking some...