-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AOT : Chunk files missing and big size files for lazy loaded files #3751
Comments
I have the same problem |
I think there is a couple things going on here. I ran
|
I think that problem is not in disabled shaking because viewing vendor.bundle with source-map-explorer revealed that angular compiler is still in bundle |
@jujyfruits part of it is the disabled shaking. |
I'd appreciate a small repro where this happens so we could look at debugging it. In our current tests we can't see this happening. |
Hi |
Is it okay , if i share my essential codes? I can't share the code. import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; if (environment.production) { platformBrowserDynamic().bootstrapModule(AppModule); import { TimepickerModule,ModalModule,TooltipModule,TabsModule } from 'ng2-bootstrap'; @NgModule({ const routes: Routes = [ @NgModule({ import { SharedModule} from 'app/shared/shared.module'; @NgModule({
}) export class TicketsModule { }` As mentioned earlier the poject is created on beta.16. |
ng -v angular-cli: 1.0.0-beta.24 |
I'm also experiencing missing chunks, this happens when the router tree looks like
If I put every route at the same level the modules can be found but as soon as it's like the above it doesn't work which is really stupid because it doesn't make sense to have child routes at the same tree level as the parent route.. |
@filipesilva could you please look into this. |
@harilal Beta.21 doesn't have AOT by default, that's probably why you have the chunk files there. |
@chrillewoodz then AOT is not working in the latest version also, right? |
Yes, there's another open issue that suggests that AOT is broken with 2 level deep nested routes. They're working on fixing it. |
@filipesilva @chrillewoodz which version does support AOT for lazy loading? 19-3 supports AOT? |
I have a similar issue on .25.5 using PROD and AOT. It only ever generates the 4 main bundles although I am using Child Routes and lazy loading. Interestingly, I had the same problem on .21 (ie. I have never seen extra chunk files with lazy loading). |
You can inspect the bundles - see https://angular.io/docs/ts/latest/cookbook/aot-compiler.html "Inspect the Bundle" |
@hansl Could you please reopen this issue. This issue is still there . And the size has increased lot in v30. |
I'm seeing a possibly related issue in the following setup: I have two lazy-loaded modules From looking at the generated bundles, both chunks contain a full copy of chart.js.... @harilalinapp is that issue similar to what you are seeing? @hansl is that the expected behavior of webpack in this case? I was expecting it would generate three chunks (for A, B and the chart NgModule) and lazy-loading the third. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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
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?
Versions.
Repro steps.
The log given by the failure.
Mention any other details that might be useful.
The text was updated successfully, but these errors were encountered: