-
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
ng build should not require @angular/* modules that are not used #5967
Comments
I reproduced this behaviour with same versions, and got same error message. |
👍 |
I tested myself and can verify it as well.
I think this is related to how lazy route detection tries to find router tokens but there is no direct dependency on it. Perhaps /cc @hansl |
I can reproduce in 4.2.4 with 1.1.3 cli. Dependency seems to come from [angular-cli, blueprints, compiler-cli] |
Fixes angular#5967 If the router isnt in node_modules then there's no reason to fail, just pretend there are no lazy routes.
The webpack plugin uses |
Fixes #5967 If the router isnt in node_modules then there's no reason to fail, just pretend there are no lazy routes.
Fixes angular#5967 If the router isnt in node_modules then there's no reason to fail, just pretend there are no lazy routes.
Fixes angular#5967 If the router isnt in node_modules then there's no reason to fail, just pretend there are no lazy routes.
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. |
Bug Report or Feature Request (mark with an
x
)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.
The text was updated successfully, but these errors were encountered: