-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Description
Bug, feature request, or proposal:
Perhaps I am misunderstanding what is going on here but it seems that importing any (sub)module from @angular/material
will cause @angular/forms
content to be included in the output vendor
bundle when using @angular/cli
.
What is the expected behavior?
Either for the external dependencies of modules to be explicitly stated or for an unrelated module not to be included in the output vendor bundle.
What is the current behavior?
Content from @angular/forms
is included in vendor.bundle.js
when importing a trivial Material module like MdCardModule
.
What are the steps to reproduce?
- Install Angular CLI (v1.2.2):
npm i -g @angular/cli
- Create a new project:
ng new temp
- Execute a development build:
ng build
- Verify that no content from
@angular/forms
is included in thevendor
bundle (e.g. search for a symbol likeFormBuilder
) - Import
MdCardModule
:npm i -S @angular/material @angular/cdk
and addMdCardModule
to theNgModule
's imports - Execute another development build:
ng build
- Verify that
@angular/forms
content is now included in thevendor
bundle
Note: it does seem like this content is removed from a production build (as it is unused). My query is why it is there in the first place.
What is the use-case or motivation for changing an existing behavior?
Module dependencies should be clear to the developer.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular 4.3.1, Angular CLI 1.2.2, Material 2.0.0-beta.8, Windows 10
Is there anything else we should know?
No
Metadata
Metadata
Assignees
Labels
No labels