How to bundle lazy loaded components inside the production dist folder in angular-cli? : <p>I am using <code>angular-cli</code> for development and I have used the following commands and code to build my project.</p>

<p><code>npm install angular-cli</code> (angular-cli: 1.0.0-beta.10)</p>

<p><code>ng new my-app</code></p>

<p><code>ng g component lazy-me</code></p>

<p>Then added a file <code>app.router.ts</code> with the following script</p>

<pre><code>import { provideRouter, RouterConfig } from '@angular/router';
import { AppComponent } from './app.component';
// import { LazyMeComponent } from './+lazy-me/lazy-me.component';

const appRoutes : RouterConfig = [
  {path: '', component: AppComponent},
//   {path: 'lazyme', component: LazyMeComponent}
  {path: 'lazyme', component: 'app/+lazy-me#LazyMeComponent'}
];

export const APP_ROUTER_PROVIDER = [
    provideRouter(appRoutes)
];
</code></pre>

<p>And changed my main.ts as following</p>

<pre><code>import { bootstrap } from '@angular/platform-browser-dynamic';
import { enableProdMode,
    SystemJsComponentResolver, 
    ComponentResolver } from '@angular/core';
import {RuntimeCompiler} from '@angular/compiler';
import { AppComponent, environment } from './app/';

import { APP_ROUTER_PROVIDER } from './app/app.router';

if (environment.production) {
    enableProdMode();
}

bootstrap(AppComponent,[
  APP_ROUTER_PROVIDER,
  {
    provide: ComponentResolver,
    useFactory: (r) =&gt; new SystemJsComponentResolver(r),
    deps: [RuntimeCompiler]
  },
]);
</code></pre>

<p>And to do a production build I have used the following command
<code>ng build -prod</code></p>

<p>When I deploy my code to a webserver and navigate to <code>lazyme</code> path, I get 404 error for <code>app/lazy-me/lazy-me.component.js</code></p>

<p>The folder exists but <code>lazy-me.component.js</code> is missing as expected as everything gets bundled in <code>main.js</code> except .css and .html files.
However, I want <code>ng build -prod</code> to include <code>lazy-me.component.js</code> in <code>dist/app/lazy-me/</code>.</p>

<p>Is there any settings in <code>system-config.ts</code> or anywhere else where I can include lazy loaded components to be part of the <code>dist</code> folder when doing a <code>-prod</code> build?</p>
