<p dir="auto">While using Typescript I've encountered a problem with packaging of an application: it is splitted into separate js files and can't be bundled into one file because of duplication of variables and file-related modules system used by SystemJS. I've tried AMD and CommonJS, both with the same result. For example, there will be an error if we have some main application file and importing another file from a folder "services", just like this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import {NodeXHRImpl} from 'services/NodeXHRImpl';"><pre class="notranslate"><code class="notranslate">import {NodeXHRImpl} from 'services/NodeXHRImpl';
</code></pre></div>
<p dir="auto">I've also tried to wrap my NodeXHRImpl class into a module named "services", and import it with a "require" keyword:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import NodeXHRImpl = require('services/NodeXHRImpl')"><pre class="notranslate"><code class="notranslate">import NodeXHRImpl = require('services/NodeXHRImpl')
</code></pre></div>
<p dir="auto">after that got an error sounds like "object is not a function" when tried to instantiate an imported class. And another thing: the compiler inserts the Reflect.decorate function that is duplicated among all compiled files and it seem like not a good option for production.<br>
It will be a very handy to have some minimal application demonstrating the modularity and, what is most important, it should be production-ready, i.e. possible to be bundled into a single file(or a bunch of files separated by functionality, for example).</p>
<p dir="auto">Currently there is a mix of <a href="https://github.com/angular/angular/blob/42b4b6d21b5c629bf938a19afc4196cfb0ea4813/modules/%40angular/core/src/console.ts#L12-L17"><code class="notranslate">Console</code></a> service and <a href="https://github.com/angular/angular/blob/42b4b6d21b5c629bf938a19afc4196cfb0ea4813/modules/@angular/platform-browser/src/dom/dom_adapter.ts#L43-L46"><code class="notranslate">getDom().log()</code></a></p>
<p dir="auto">We should unify the log reporting in a Log service.</p>