when I install definition files with typings, two definition files are created: One of them in typings/browser and the other in typings/main. Why does this happen and how do I prevent it, because it causes many Dublciate identifier exceptions.
Asked
Active
Viewed 43 times
1 Answers
2
You have to add either add the browser
directory and definition file, or the main
directory and definition file to the exclude section of your tscofing.json
file to eliminate the errors. Like so:
exclude: ["typings/browser", "typings/browser.d.ts"]
or
exclude: ["typings/main", "typings/main.d.ts"]
In short, this is so that developers can expose different sets of functionality for browser and non-browser TypeScript applications.

rgvassar
- 5,635
- 1
- 24
- 31
-
Thanks a lot I already added "typings/browser" to the exclude list but I didn't add "typings/browser.d.ts" – Ced Apr 14 '16 at 20:32