<p dir="auto">In VS 2015 Pro, using the Asp.Net 5 Web Application template, I have installed via npm the typings js module, which in concert with a typings.json file will install Typescript definition files to a typings folder as so...</p>
<ul dir="auto">
<li>Project
<ul dir="auto">
<li>wwwroot</li>
<li>Controllers</li>
<li>scripts</li>
<li>typings
<ul dir="auto">
<li>browser</li>
<li>main</li>
<li>browser.d.ts</li>
<li>main.d.ts</li>
</ul>
</li>
<li>Views</li>
<li>tsconfig.json</li>
<li>typings.json</li>
</ul>
</li>
</ul>
<p dir="auto">The browser folder and browser.d.ts is intended for clientside while the main folder and main.d.ts file are intended for serverside, and one should pick which they want to use, and exclude the other.</p>
<p dir="auto">With TS 1.7.3 installed, one excluded the main files in the tsconfig.json as so (this worked - last two entries in exclude array):</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  &quot;compilerOptions&quot;: {
    &quot;noImplicitAny&quot;: false,
    &quot;noEmitOnError&quot;: true,
    &quot;removeComments&quot;: false,
    &quot;sourceMap&quot;: true,
    &quot;target&quot;: &quot;es5&quot;,
    &quot;outDir&quot;: &quot;wwwroot/js&quot;,
    &quot;rootDir&quot;: &quot;scripts&quot;,
    &quot;moduleResolution&quot;: &quot;node&quot;,
    &quot;emitDecoratorMetadata&quot;: true,
    &quot;experimentalDecorators&quot;: true,
    &quot;module&quot;: &quot;system&quot;
  },
  &quot;exclude&quot;: [
    &quot;node_modules&quot;,
    &quot;wwwroot&quot;,
    &quot;typings/main&quot;,
    &quot;typings/main.d.ts&quot;
  ]
}"><pre class="notranslate">{
  <span class="pl-ent">"compilerOptions"</span>: {
    <span class="pl-ent">"noImplicitAny"</span>: <span class="pl-c1">false</span>,
    <span class="pl-ent">"noEmitOnError"</span>: <span class="pl-c1">true</span>,
    <span class="pl-ent">"removeComments"</span>: <span class="pl-c1">false</span>,
    <span class="pl-ent">"sourceMap"</span>: <span class="pl-c1">true</span>,
    <span class="pl-ent">"target"</span>: <span class="pl-s"><span class="pl-pds">"</span>es5<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"outDir"</span>: <span class="pl-s"><span class="pl-pds">"</span>wwwroot/js<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"rootDir"</span>: <span class="pl-s"><span class="pl-pds">"</span>scripts<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"moduleResolution"</span>: <span class="pl-s"><span class="pl-pds">"</span>node<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"emitDecoratorMetadata"</span>: <span class="pl-c1">true</span>,
    <span class="pl-ent">"experimentalDecorators"</span>: <span class="pl-c1">true</span>,
    <span class="pl-ent">"module"</span>: <span class="pl-s"><span class="pl-pds">"</span>system<span class="pl-pds">"</span></span>
  },
  <span class="pl-ent">"exclude"</span>: [
    <span class="pl-s"><span class="pl-pds">"</span>node_modules<span class="pl-pds">"</span></span>,
    <span class="pl-s"><span class="pl-pds">"</span>wwwroot<span class="pl-pds">"</span></span>,
    <span class="pl-s"><span class="pl-pds">"</span>typings/main<span class="pl-pds">"</span></span>,
    <span class="pl-s"><span class="pl-pds">"</span>typings/main.d.ts<span class="pl-pds">"</span></span>
  ]
}</pre></div>
<p dir="auto">After installing TS 1.8.4, I now get Duplicate identifier errors between files in the typings/main and typings/browser folder.  In other words, the subfolder exclude for "typings/main" is not being respected.</p>
<p dir="auto">Experimenting a bit, the "node_modules" and "wwwroot" is being excluded correctly.  If I exclude the root folder "typings" then the error goes away, but no typings load from any files either.  Also trying to exclude a file in a subfolder, say "typings/main/ambient/bootstrap/bootstrap.d.ts" doesn't work.  So there appears to be a bug excluding subfolders/subfiles.</p>
<p dir="auto">The expected behavior is for subfiles or subfolders in the exclude array to be ignored during compile.  The actual behavior is that they are not excluded.</p>
<p dir="auto"><strong>TypeScript Version:</strong></p>
<p dir="auto">1.8.2</p>
<p dir="auto"><strong>Code</strong></p>
<p dir="auto">foo.ts</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var foo: number = &quot;s&quot;;"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">foo</span>: <span class="pl-smi">number</span> <span class="pl-c1">=</span> <span class="pl-s">"s"</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">tsconfig.json</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
    &quot;compilerOptions&quot;: {
        &quot;module&quot;: &quot;commonjs&quot;,
        &quot;target&quot;: &quot;es5&quot;
    },
    &quot;exclude&quot;: [
        &quot;foo.ts&quot;
    ]
}"><pre class="notranslate">{
    <span class="pl-ent">"compilerOptions"</span>: {
        <span class="pl-ent">"module"</span>: <span class="pl-s"><span class="pl-pds">"</span>commonjs<span class="pl-pds">"</span></span>,
        <span class="pl-ent">"target"</span>: <span class="pl-s"><span class="pl-pds">"</span>es5<span class="pl-pds">"</span></span>
    },
    <span class="pl-ent">"exclude"</span>: [
        <span class="pl-s"><span class="pl-pds">"</span>foo.ts<span class="pl-pds">"</span></span>
    ]
}</pre></div>
<p dir="auto"><strong>Expected behavior:</strong></p>
<p dir="auto">In an NTVS typescript console application using the above tsconfig.json, and a file foo.ts containing an error, the build and run initiated by Visual Studio should succeed because the file containing the error is excluded.</p>
<p dir="auto"><strong>Actual behavior:</strong></p>
<p dir="auto">The build fails with an error in foo.ts. Compiling from command line, the build succeeds. Also, if foo.ts is put inside a folder, and the folder is listed in the exclude array, the VS build succeeds.</p>
<p dir="auto">This is currently breaking projects using the typings tool, because it generates two sets of type definitions, and the other set cannot be excluded.</p>