Description
I am concerned about the size and type of bundles generated by cli .
Previously there are 2-3 bundles which will be loaded on demand only . But in current version it shows the main bundle size is increased and there are no bundles for the lazy loaded bundles. Since am using same codebase i get different bundle size.
This is my app-routing
import { NgModule } from '@angular/core';
import { Routes, RouterModule, PreloadAllModules } from '@angular/router';
import { LoginComponent } from './auth/login.component';
import { AuthGuard } from './auth/auth.guard';
const routes: Routes = [
{
path:'',
redirectTo: '/login',
pathMatch: 'full'
},
{
path:'login',
//component: LoginComponent
loadChildren: './auth/auth.module#AuthModule',
},
{
path: 'tickets',
loadChildren: './tickets/tickets.module#TicketsModule',
canActivate:[AuthGuard],
},
{
path: 'clients',
loadChildren: './clients/clients.module#ClientsModule',
canActivate: [AuthGuard],
}
];
@NgModule({
imports: [RouterModule.forRoot(routes, { useHash: true, preloadingStrategy: PreloadAllModules })],
exports: [RouterModule],
providers: []
})
export class MyRoutingModule { }
Here are my test results
Angular -cli : 1.0.0-beta.21
Angular- cli:1.0.0-beta.24
Command : ng build --prod --aot
Angular- cli:1.0.0-beta.24
Command : ng build --prod
Angular- cli:1.0.0-beta.24
Command : ng build
You can see the difference. While build with aot in 21 makes a big difference in size.
While in 24 , even using --aot doesn't change the size of the bundle and also there is no separate chunk for modules.
OS?
Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Ubuntu 14.04
Versions.
Please run
ng --version
. If there's nothing outputted, please run in a Terminal:node --version
and paste the result here:
angular-cli: 1.0.0-beta.24
node: 6.9.1
os: linux x64
@angular/common: 2.4.1
@angular/compiler: 2.4.1
@angular/core: 2.4.1
@angular/forms: 2.4.1
@angular/http: 2.4.1
@angular/material: 2.0.0-beta.1
@angular/platform-browser: 2.4.1
@angular/platform-browser-dynamic: 2.4.1
@angular/router: 3.4.1
@angular/compiler-cli: 2.4.1
Repro steps.
Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
The log given by the failure.
Normally this include a stack trace and some more information.
Mention any other details that might be useful.
Thanks! We'll be in touch soon.