I'm writing Angular 2 Universal app, so I don't want any DOM types.
But I want to compile all files in dir, so setting "file" in tsconfig.json is not acceptable.
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 ).
The tsconfig. json is generally put in the root folder of the project.
Running tsc locally will compile the closest project defined by a tsconfig. json , you can compile a set of TypeScript files by passing in a glob of files you want.
But I want to compile all files in dir, so setting "file"
file has no effect on lib.d.ts anyways.
lib.es2015.core.d.ts in tsconfig.json
If you want core you would do:
"compilerOptions": {
"target": "es5",
"lib": ["es5","es2015.core"]
}
More : https://github.com/basarat/typescript-book/blob/master/docs/types/lib.d.ts.md#lib-option
However you most likely want to include all of es6 and not just core or array etc.:
"compilerOptions": {
"target": "es5",
"lib": ["es6"]
}
typescript@>2.0
"compilerOptions": {
...
"lib": ["es5", "es6", "es6.array"]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With