<p dir="auto">TypeScript version: 1.7.5<br>
For example:</p>
<p dir="auto">hoge.ts</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export default class Hoge {}"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-k">class</span> <span class="pl-smi">Hoge</span> <span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>
<p dir="auto">fuga.ts</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import Hoge from &quot;./hoge&quot;
new Hoge();"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-smi">Hoge</span> <span class="pl-k">from</span> <span class="pl-s">"./hoge"</span>
<span class="pl-k">new</span> <span class="pl-smi">Hoge</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><code class="notranslate">tsc hoge.ts fuga.ts -t es6 -m commonjs</code><br>
compile result:<br>
hoge.js</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class Hoge {
}
exports.Hoge = Hoge;"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">Hoge</span> <span class="pl-kos">{</span>
<span class="pl-kos">}</span>
<span class="pl-s1">exports</span><span class="pl-kos">.</span><span class="pl-c1">Hoge</span> <span class="pl-c1">=</span> <span class="pl-v">Hoge</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">fuga.js</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var hoge_1 = require(&quot;./hoge&quot;);
new hoge_1.default();"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">hoge_1</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./hoge"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">new</span> <span class="pl-s1">hoge_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></pre></div>
<p dir="auto">Compiled code doesn't work because <code class="notranslate">require("./hoge")</code> returns <code class="notranslate">{ Hoge: Hoge }</code> and <code class="notranslate">hoge_1.default</code> is undefined.</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export default class {

}"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-k">class</span> <span class="pl-kos">{</span>

<span class="pl-kos">}</span></pre></div>
<p dir="auto">compiled code is:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class {
}
exports. = default_1;
"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-kos">{</span>
<span class="pl-kos">}</span>
<span class="pl-s1">exports</span><span class="pl-kos">.</span> <span class="pl-c1">=</span> <span class="pl-c1">default_1</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">compile command is <code class="notranslate">tsc --module commonjs --target ES6 default.ts</code>, TypeScript version is 1.7.5</p>