-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
@nrwl/angular installs as a production dependency #6885
Comments
Thanks for reporting this! This is intended. The If you're using any of those utilities, you need it as a I'll keep this open to be clearer in the docs about this fact. |
The NgRx utilities are no doubt useful and I appreciate that they are provided by Nx, but perhaps it's better to split those utilities off from For example |
I may be wrong, but an If you do not make any references to |
This is the behavior of npm install on a local machine, however in CI/CD environment in a large enterprise, you'd typically run As @nrwl/angular is listed in prod Yes the tree-shaking occurs and my web browser user is unaffected, but my artifacts and containers are bloated. To be clear, it makes sense that @nrwl/angular is a production dependency, as I want to use its utilities. The problem is that there are production-code-worthy aspects in this library (NgRx) as well as generators and build-time tooling (@nrwl/angular:webpack-browser) I would suggest this team extracts the prod code from this into something like |
@eternalmatt Out of curiosity, why do you need the node_modules copied into a container? The built artefact should be the static files you need to host your Angular application right? We will take the suggestion of creating a new package on board certainly. |
The way I noticed it was through a |
@Coly010 it's a good question. Since we are using an Nx monorepo, we have two projects together (Nestjs "api" and Angular "frontend"). The api project contains nest-express API endpoints which serve the website files (index, js, css), so there is a build-time dependency between the two. Consider we have a project directory that look as follows:
Since these are sharing a package.json, when I go to build/deploy the NestJS api, it is including all the dependencies of the frontend project. The "api" project needs node_modules at runtime. |
That makes more sense. I thought it was simply an Angular site being deployed. We'll put splitting the NgRx production code onto our internal roadmap. Thanks for highlighting the issue! :) |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. |
Can this issue be reopened? Like @Ionaru said running commands like Like others said, if it is needed for ngrx utilities, these should be moved to their own package imho. |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
Using
create-nx-workspace
and selecting any template that includes Angular installs@nrwl/angular
underdependencies
instead ofdevDependencies
.In the documentation it is shown that
![image](https://user-images.githubusercontent.com/3472373/131225495-faf1c124-94d8-46e5-ad77-c6bb6ffb7ab4.png)
@nrwl/angular
should be installed as a devdependency.This behaviour causes all kinds of (normally) devDependencies to be installed as regular dependencies. Like everything
![image](https://user-images.githubusercontent.com/3472373/131225571-bb983267-238f-4753-a993-43c4320910ac.png)
@nrwl/angular
depends on, their dependencies, their dependencies and so on.Expected Behavior
@nrwl/angular
is installed underdevDependencies
.Steps to Reproduce
Failure Logs
None.
Environment
Additional information
This issue was noticed earlier by @eternalmatt and reported in #3618.
The text was updated successfully, but these errors were encountered: