<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[X] bug report
[ ] feature request
[ ] support request"><pre class="notranslate"><code class="notranslate">[X] bug report
[ ] feature request
[ ] support request
</code></pre></div>
<p dir="auto"><strong>Current behavior</strong><br>
Let's suppose we have to following modules:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="AppModule
  -&gt; imports FeatureModule
     -&gt; import SubFeatureModule"><pre class="notranslate"><code class="notranslate">AppModule
  -&gt; imports FeatureModule
     -&gt; import SubFeatureModule
</code></pre></div>
<p dir="auto"><code class="notranslate">FeatureModule</code> has routes definitions</p>
<p dir="auto"><code class="notranslate">SubFeatureModule</code> has component and router guard (resolve). Component declares its resolves via static field (to keep it in one place)</p>
<p dir="auto">So <code class="notranslate">FeatureModule</code> declares a route, that lands to the component from <code class="notranslate">SubFeatureModule</code> and resolves given guard.</p>
<p dir="auto">In runtime (browser-dynamic) everything works as expected. But when we compile with angular-compiler, among imports a duplicate entry appears for resolver, and it has wrong path.</p>
<p dir="auto">Although, resolution via static fields in AoT in other cases works fine, I could not figure out why it fails in this case.</p>
<p dir="auto"><strong>Minimal reproduction of the problem with instructions</strong><br>
I've created a repository with minimal code to reproduce:<br>
<a href="https://github.com/beenokle/angular-compiler-bug">Source code to reproduce</a></p>
<p dir="auto"><strong>Please tell us about your environment:</strong></p>
<ul dir="auto">
<li><strong>Angular version:</strong><br>
2.0.1</li>
<li><strong>Language:</strong><br>
<code class="notranslate">typescript@2.0.3</code></li>
<li><strong>Node (for AoT issues):</strong><br>
<code class="notranslate">node version 6.5.0</code></li>
</ul>
<p dir="auto">Typescript emits an <code class="notranslate">__extends</code> helper to, well, help with extending classes.</p>
<p dir="auto">It currently shows up a few dozen times in our codebase, turning it off in the broccoli tree saves ~70KB unminified / 44KB minified in the existing System bundles.</p>
<p dir="auto">option is <code class="notranslate">noEmitHelpers: true</code></p>
<p dir="auto">Same optimization in Rx saves ~20KB or so, will submit a PR over there as well.</p>
<p dir="auto">We'll need to include it at least once, of course, so this might be best added into our proposed "ngPolyfill" along with Reflect?</p>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/IgorMinar/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/IgorMinar">@IgorMinar</a></p>