Skip to content

ng build should not require @angular/* modules that are not used #5967

Closed
@jrood

Description

@jrood

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.0.0
node: 6.9.5
os: darwin x64
@angular/common: 4.0.2
@angular/compiler: 4.0.2
@angular/core: 4.0.2
@angular/forms: 4.0.2
@angular/http: 4.0.2
@angular/platform-browser: 4.0.2
@angular/platform-browser-dynamic: 4.0.2
@angular/cli: 1.0.0
@angular/compiler-cli: 4.0.2

Repro steps.

ng new test-app
cd test-app
npm r --save @angular/router
ng build
It should return ERROR in Could not resolve module @angular/router
It should not be trying to resolve @angular/router if it is not being used.

Desired functionality.

When an application is not using the @angular/router, the ng cli should not attempt to resolve it.
Angular already aspires to be granular. It seems the purpose of splitting things up into /core /forms /http /router and so on is to let developers only include the parts they need. If the ng cli requires all these packages, even when they are not used, it seems that this purpose is thwarted.

Metadata

Metadata

Assignees

Labels

P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfuleffort2: medium (days)freq1: lowOnly reported by a handful of users who observe it rarelyseverity2: inconvenient

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions