Typescript .d.ts Compilation Errors
<p>I am using Visual Studio 2015 Pro to develop a .Net Core Angular 2 project using Systemjs and Kendo UI Angular 2 components.</p>

<p>I am using Gulp to copy library files from node_modules to "wwwroot/shared/lib" and excluding both directories from compilation in tsconfig.json.</p>

<p>Everything works properly until I include a Kendo UI module, which causes typescript to compile .d.ts files in the "node_modules/@progress/[component-name]/dist/npm/js" directory.</p>

<p>I am excluding node_modules in tsconfig.json, so I'm guessing that the Kendo UI component code is somehow referencing the .d.ts files somehow.</p>

<p>When I exclude "wwwroot" instead of "wwwroot/shared/lib", the project compiles without error (because all of my .ts files are in "wwwroot").</p>

<p>The weird thing is that when I change it back to "wwwroot/shared/lib", it still works! But once I restart VS I get the errors again (?!)</p>

<p>All of the errors are specific to .d.ts files in the "node_modules/@progress" folder. There are plenty of .d.ts files in "node_modules/@angular" that aren't causing any problems, so this has to be specific to Kendo UI code.</p>

<p>Is there any way to keep VS from compiling .d.ts files, regardless of their location?</p>

<p>Here is my tsconfig:</p>

<pre><code>"compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": true,
    "suppressImplicitAnyIndexErrors": true
},
"compileOnSave": true,
"exclude": [
    "node_modules",
    "wwwroot/shared/lib"
    //  ,
    //"wwwroot"
]
</code></pre>

<p>UPDATE</p>

<p>Seemingly at random, the errors will jump from 6 to 149 - including error TS2304: Cannot find name 'module', 'map', etc...</p>

<p>I've tried adding <code>"skipDefaultLibCheck": true</code> to tsconfig with no luck.</p>

<p>Adding <code>"types": [ "node" ]</code> will cause tsc.exe to exit with code 1, unless I do the trick where I exclude "wwwroot", then run the project, and then include it again. </p>

<p>Everything always works fine after I do that - until I restart VS and everything blows up.</p>

<p>UPDATE 2</p>

<p>I installed the latest version of Typescript for Visual Studio 2015 (TypeScript_Dev14Full), which appears to have resolved most of the aforementioned problems, though I am now left with a new error: </p>

<p>"TS2309 Build:An export assignment cannot be used in a module with other exported elements."  on \node_modules\@types\node\index.d.ts</p>

<p>The error appears twice, once for Project: "TypeScript Virtual Projects" and Project: "DevDashLocal".</p>

<p>I rebuilt the project with the newest versions .Net Core SDK and Typescript and am receiving the same errors in the new project.</p>