Typescript lazy load ember modules with requirejs
<p>We are in process of splitting our large ember app into logical chunks and delay load few of the modules to improve performance.</p>

<p>We have an <strong>entry</strong> which in turn recursively includes all dependencies and creates one big rjs optimized file during build process. We want to load few core components and the routes during initial load and delay load everything else. </p>

<p>We want to nest our require calls inside <strong>route</strong> and use <strong>beforeModelHook</strong> to load dependent controllers, templates, components as specified in this guide <a href="http://toranbillups.com/blog/archive/2014/10/02/Lazy-loading-es6-modules-with-emberjs/" rel="nofollow">http://toranbillups.com/blog/archive/2014/10/02/Lazy-loading-es6-modules-with-emberjs/</a> </p>

<p>Now the problem is if we skip import statement</p>

<pre><code>import mycontroller = require("mycontroller")
</code></pre>

<p>and use nested require</p>

<pre><code>beforeModel() {
   require(["mycontroller"])
   ...
}
</code></pre>

<p>typescript fails to list <strong>mycontroller</strong> as dependency when compiled. How to resolve this issue?</p>

<p>What are other ways of achieving improving performance?</p>