From ed72d94e96c4dd0425db79497b83c6baac0906c1 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Mon, 5 Jun 2017 23:50:07 +0200 Subject: [PATCH] build: ambiguous imports in IDEs (#4958) Recently the Universal App has been added to the repository. The universal-app contains a script that runs inside of Node and therefore uses Node APIs. The global tsconfig file that is used to provide proper autocompletion in IDEs includes every TS file inside of `src/` and therefore the `prerender.ts` file is also included. This is problematic because now the NodeJS @types are being loaded as well and ambiguous imports appear in editors. Causing for example `setTimeout` calls to return a `Timer` instead of a number (error in your IDEs) --- src/tsconfig.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tsconfig.json b/src/tsconfig.json index f72a4a0509e..864cdd42a0a 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -16,5 +16,10 @@ "@angular/material": ["./lib/public_api.ts"], "@angular/cdk": ["./cdk/public_api.ts"] } - } + }, + "exclude": [ + // Exclude files that depend on Node APIs because those depend on the Node types and therefore + // cause ambiguous imports. For example `setTimeout()` will return a Timer instead of a number. + "universal-app/prerender.ts" + ] }