<h1 dir="auto">Summary</h1>
<p dir="auto">Installing TypeScript 1.7 tooling for Visual Studio causes different behaviour from 1.6 when publishing web applications, both from within Visual Studio (right click &gt; publish) and via msbuild.exe (<code class="notranslate">/p:DeployOnBuild=true</code>).</p>
<p dir="auto">This issue has only been observed using a file system publish.</p>
<h1 dir="auto">Symptoms</h1>
<p dir="auto">Generated JavaScript is no longer included in the packaged / published output.</p>
<h1 dir="auto">Observations</h1>
<p dir="auto">It appears there is a difference in the MSBuild <code class="notranslate">Content</code> ItemGroup's metadata. I believe that previously the generated JavaScript files were being included in the <code class="notranslate">Content</code> ItemGroup as paths relative to the <code class="notranslate">.csproj</code> file:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Scripts\App.js    "><pre class="notranslate"><code class="notranslate">Scripts\App.js    
</code></pre></div>
<p dir="auto">As of 1.7 it appears the generated JavaScript files are now being included in <code class="notranslate">Content</code> as absolute paths:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="C:\Projects\Solution\Web\Scripts\App.js"><pre class="notranslate"><code class="notranslate">C:\Projects\Solution\Web\Scripts\App.js
</code></pre></div>
<p dir="auto">Perhaps this is causing a problem for the web publishing mechanism?</p>
<p dir="auto">TypeScript 1.4 allows variables to be used before they are initialized.<br>
For example, both:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function dd(): number {
    var x: number;
    return x;
}"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">dd</span><span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-smi">number</span> <span class="pl-kos">{</span>
    <span class="pl-k">var</span> <span class="pl-s1">x</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span>
    <span class="pl-k">return</span> <span class="pl-s1">x</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">and</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function ddd() {
    var x: number;
    x++;
}"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">ddd</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">var</span> <span class="pl-s1">x</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span>
    <span class="pl-s1">x</span><span class="pl-c1">++</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">are allowed.</p>
<p dir="auto">It would be useful to have a compiler flag such as --noUseBeforeInit that would turn variable use before initialization into an error.</p>
<p dir="auto">This suggestion fits in with <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="38927924" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/274" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/274/hovercard" href="https://github.com/microsoft/TypeScript/issues/274">#274</a> meta-bug.</p>