<p dir="auto"><em>Inspired by the <code class="notranslate">@import</code> function of SASS.</em></p>
<p dir="auto">I would like to propose a mechanism for creating partial files, which are not compiled by default, but embedded into files which reference them. It's just like bundling, but with less hassle and in a more unified approach.</p>
<p dir="auto">As a brief example, suppose that we have 4 files:</p>
<ul dir="auto">
<li>index.ts</li>
<li>user.ts</li>
<li>_auth.ts</li>
<li>_position.ts</li>
</ul>
<p dir="auto">The <code class="notranslate">index.ts</code> and <code class="notranslate">user.ts</code> files can reference contents of a partial file by using simple imports. For example, if we want <code class="notranslate">index.ts</code> to reference <code class="notranslate">_auth.ts</code> and <code class="notranslate">_position.ts</code>, use the following code in the non-partial <code class="notranslate">index.ts</code> file:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import auth = require('auth');
import position = require('position');"><pre class="notranslate"><code class="notranslate">import auth = require('auth');
import position = require('position');
</code></pre></div>
<p dir="auto">The content of partial files should be copied and instantly evaluated in their container file. For instance, whether we would also like to use the <code class="notranslate">_position.ts</code> partial file in <code class="notranslate">user.ts</code>, use an import just like above:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import position = require('position');"><pre class="notranslate"><code class="notranslate">import position = require('position');
</code></pre></div>
<p dir="auto">Although this may seem like a regular import, it's basically an include function which copies the partial file's full content at the place desired. That means, partial files should not be reused in multiple containers, but should be used for code organisation purposes. When both <code class="notranslate">index.ts</code> and <code class="notranslate">user.ts</code> are referenced in a HTML file, the content of <code class="notranslate">_position.ts</code> will be duplicated and inserted into the 2 containers separately.</p>
<p dir="auto">Support compiling multiple input .ts files into one external module.</p>
<p dir="auto">Need to determine exactly how the module boundaries are defined when doing this.</p>