Search code examples
typescripttsctypescript-typings

How to include lib.es2015.core.d.ts in tsconfig.json?


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.


Solution

  • 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

    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"]
    }