Skip to content
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

fix(core): remove devDependencies in production build #21428

Merged
merged 2 commits into from
Jun 11, 2024

Conversation

mandarini
Copy link
Member

Moved from #17744

All credits to @robdonn.

Current Behavior

When a local package.json is loaded with a devDependencies property, that property's contents end up in the final outputted package.json, even when isProduction is set to true.

Expected Behavior

When isProduction is true then devDependencies should be removed.

Related Issue(s)

Fixes #

@mandarini mandarini requested a review from a team as a code owner January 30, 2024 16:53
Copy link

vercel bot commented Jan 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Jun 11, 2024 8:36am

@mandarini mandarini self-assigned this Jan 30, 2024
Copy link
Contributor

@meeroslav meeroslav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

I would like to have those unit tests turned on though.

@mandarini mandarini force-pushed the fix/prod-devdeps branch 2 times, most recently from c13c4cc to ec5aa7e Compare May 10, 2024 10:47
@mandarini mandarini requested a review from meeroslav May 10, 2024 10:49
@mandarini mandarini enabled auto-merge (squash) May 16, 2024 15:01
@mandarini mandarini disabled auto-merge May 16, 2024 15:01
@JamesHenry JamesHenry enabled auto-merge (squash) June 11, 2024 08:31
@JamesHenry JamesHenry merged commit 8351cb1 into nrwl:master Jun 11, 2024
6 checks passed
@TriPSs
Copy link
Contributor

TriPSs commented Jun 17, 2024

Why? Why is this not made optional (or at-least make this behavior opt in?), as a lib maintainer we add dev dependencies so that

  1. the package is available when we are developing
  2. we can import the package.json and copy it over if needed to the devDependencies of the users project
  3. we can use a tool like ncu to easy update set packages that are added to the users project
  4. we are then not forcing certain versions to our end users

Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants