title: ERROR in Cannot read property 'loadChildren' of undefined
body: <p>Webpack compilation fails throwing Cannot read property 'loadChildren' of undefined.</p>
  
  <p>This Happens when i try to load routes from some function like below</p>
  
  <pre><code>export const routes: Routes = getRoutes();
  
  function getRoutes() {
      return [{ path: 'homepage', component: HomeComponent }];
  }
  </code></pre>
  
  <p>When i export routes normally the webpack compilation will be successful.like below,</p>
  
  <pre><code>export const routes: Routes = [{ path: 'homepage', component: HomeComponent }];
  </code></pre>
  
  <p>And am mounting these routes in lazy loaded module.</p>