components icon indicating copy to clipboard operation
components copied to clipboard

Lazy loading module with material dependencies also includes typings

Open chriszrc opened this issue 9 years ago • 4 comments

Bug, feature request, or proposal:

Bug

What is the expected behavior?

No typings dependencies would be included for a prod build

What is the current behavior?

the @angular/material/typings/index.ngfactory.ts is included in a prod build when using lazy loaded modules

What are the steps to reproduce?

convert the angular app to use lazy loaded modules like:

export const APP_ROUTES: Routes = [
  { path: '', component: AppComponent},
  { path: 'lazy', loadChildren: '../map/overview-ap.module#OverviewMapModule' }
];

And do a prod cli build with sourcemaps:

ng build --prod --sourcemaps

and then inspect with source map explorer: screen shot 2017-07-13 at 2 38 12 pm

What is the use-case or motivation for changing an existing behavior?

We don't want unnecessary files in the prod build

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

angular-cli - 1.2.0 angular 4.2.6 angular-material 2.0.0-beta.8 typescript 2.2.2

chriszrc avatar Jul 13 '17 19:07 chriszrc

+1 I am seeing this too. any way around this?

kemmis avatar Aug 13 '17 15:08 kemmis

It's not typing information, it's the generated code from AoT for the whole library.

Tracked via #4137

jelbourn avatar Aug 17 '17 22:08 jelbourn

So, is it correct, that in final bundle for each material module we have *.es5.js and *typings/index.ngfactory.js files? 2018-10-31_17-23-38

armaserg avatar Oct 31 '18 15:10 armaserg

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.