Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the tsconfig option "lib" do?

Tags:

typescript

People also ask

What is Lib Tsconfig?

TypeScript includes a default set of type definitions for built-in JS APIs (like Math ), as well as type definitions for things found in browser environments (like document ).

What is the purpose of Tsconfig?

The tsconfig. json file allows you to specify the root level files and the compiler options that requires to compile a TypeScript project. The presence of this file in a directory specifies that the said directory is the TypeScript project root.

What is Tsconfig in angular?

A given Angular workspace contains several TypeScript configuration files. At the root tsconfig. json file specifies the base TypeScript and Angular compiler options that all projects in the workspace inherit. See the Angular compiler options guide for information about what Angular specific options are available.

Where do I put Tsconfig?

The tsconfig. json is generally put in the root folder of the project.


This is a new typescript 2 feature and so it still lacks documentation, but you can read about it in the What's new in Typescript 2.0:

with --lib you can specify a list of built-in API declaration groups that you can chose to include in your project. For instance, if you expect your runtime to have support for Map, Set and Promise (e.g. most evergreen browsers today), just include --lib es2015.collection,es2015.promise. Similarly you can exclude declarations you do not want to include in your project, e.g. DOM if you are working on a node project using --lib es5,es6.

There's also a list of the API groups that are supported and a very short example in that link.