nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.82k stars 2.38k forks source link

Clarification on @nrwl/angular as a prod dependency #3618

Closed eternalmatt closed 3 years ago

eternalmatt commented 4 years ago

The instructions to install @nrwl/angular are as a devDependency (--save-dev) https://nx.dev/angular/plugins/angular/overview#adding-the-angular-plugin

However, I would like to use fetch from '@nrwl/angular' in production code as in: https://nx.dev/angular/guides/misc-data-persistence

As such it is including many unnecessary files in my production node_modules

$ npm ls @nrwl/cypress --prod
my-application
`-- @nrwl/angular@10.0.11
  `-- @nrwl/cypress@10.0.11

Question, should the docs be updated to be npm install --save @nrwl/angular (at least for the data-persistence guide)?

Longer term, maybe the helper functions designed for production use should be put in another package. I'm not fully trustworthy of treeshaking that it will remove all @types directories from @nrwl/angular; and besides I don't want these packages bundled in my production artifact, even if they won't get shipped to the client.

eternalmatt commented 4 years ago

We are experiencing an issue in our test environment where users who have not installed the Chrome extension Redux DevTools are unable to interact with our app, as the initial fetch calls are failing.

We are going to replace these calls, and move @nrwl/angular to devDependencies.

github-actions[bot] commented 4 years ago

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. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! 🙏

github-actions[bot] commented 1 year ago

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.