nx icon indicating copy to clipboard operation
nx copied to clipboard

fix(core): remove devDependencies in production build

Open mandarini opened this issue 1 year ago • 2 comments

Moved from https://github.com/nrwl/nx/pull/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 avatar Jan 30 '24 16:01 mandarini

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

vercel[bot] avatar Jan 30 '24 16:01 vercel[bot]

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

TriPSs avatar Jun 17 '24 15:06 TriPSs

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[bot] avatar Jun 24 '24 00:06 github-actions[bot]