<p dir="auto">The following typescript (using the new module system syntax)</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import &quot;foo&quot;;"><pre class="notranslate"><code class="notranslate">import "foo";
</code></pre></div>
<p dir="auto">generates the following invalid javascript:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="define([&quot;require&quot;, &quot;exports&quot;, &quot;foo&quot;], function (require, exports, ) "><pre class="notranslate"><code class="notranslate">define(["require", "exports", "foo"], function (require, exports, ) 
</code></pre></div>
<p dir="auto">Given this code:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// foo.ts
import './bar';
import baz from './baz';
baz;

// bar.ts
export default function bar() {}

// baz.ts
export default function baz() {}"><pre class="notranslate"><span class="pl-c">// foo.ts</span>
<span class="pl-k">import</span> <span class="pl-s">'./bar'</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-s1">baz</span> <span class="pl-k">from</span> <span class="pl-s">'./baz'</span><span class="pl-kos">;</span>
<span class="pl-s1">baz</span><span class="pl-kos">;</span>

<span class="pl-c">// bar.ts</span>
<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-k">function</span> <span class="pl-en">bar</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>

<span class="pl-c">// baz.ts</span>
<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-k">function</span> <span class="pl-en">baz</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>
<p dir="auto">Repro: <code class="notranslate">tsc -m amd foo.ts</code></p>
<p dir="auto">Expected output:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="define([&quot;require&quot;, &quot;exports&quot;, './baz', './bar'], function (require, exports, baz_1) {
  baz_1.default;
});"><pre class="notranslate"><span class="pl-en">define</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-s">"require"</span><span class="pl-kos">,</span> <span class="pl-s">"exports"</span><span class="pl-kos">,</span> <span class="pl-s">'./baz'</span><span class="pl-kos">,</span> <span class="pl-s">'./bar'</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">require</span><span class="pl-kos">,</span> <span class="pl-s1">exports</span><span class="pl-kos">,</span> <span class="pl-s1">baz_1</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-s1">baz_1</span><span class="pl-kos">.</span><span class="pl-c1">default</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Actual output:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="define([&quot;require&quot;, &quot;exports&quot;, './bar', './baz'], function (require, exports, , baz_1) {
  baz_1.default;
});"><pre class="notranslate"><span class="pl-en">define</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-s">"require"</span><span class="pl-kos">,</span> <span class="pl-s">"exports"</span><span class="pl-kos">,</span> <span class="pl-s">'./bar'</span><span class="pl-kos">,</span> <span class="pl-s">'./baz'</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">require</span><span class="pl-kos">,</span> <span class="pl-s1">exports</span><span class="pl-kos">,</span> <span class="pl-kos">,</span> <span class="pl-s1">baz_1</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-s1">baz_1</span><span class="pl-kos">.</span><span class="pl-c1">default</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Version: <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/microsoft/TypeScript/commit/fb44a23b758f212c722360fbc4790c539d55bf94/hovercard" href="https://github.com/microsoft/TypeScript/commit/fb44a23b758f212c722360fbc4790c539d55bf94"><tt>fb44a23</tt></a></p>