You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The supported package managers allow for the installation of only production dependencies. This is usually motivated by a desire for a smaller deployment footprint.
Since ni already supports the "mirror" -D flag for installing only development dependencies, I propose adding the -P flag for installing only production dependencies.
Suggested solution
I suggest adding the -P flag to the ni command, which should instruct agents to install only production dependencies (as defined by the agent). I am happy to provide a PR for it.
Ideally, I'd like to combine clean install (nci a.k.a. ni --frozen) with -P flag, but that would require a change frozen command in antfu-collective/package-manager-detector to accept a parameter. This is my ultimate motivation for the change.
New versions of npm have deprecated --production flag, and will print a warning suggesting using --omit=dev. My current PR uses the new (--omit=dev) flag. If we want to support --production flag for older versions (I believe v6 and prior) of npm that do not support --omit we would need to make a change in antfu-collective/package-manager-detector to support that.
If you're up for making these changes, I'd happily provide PRs for them.
I noticed that I am proposing using the same flag (-P) for installing production dependencies as @yamcodes proposes for installing peer dependencies in #248 . We may have to decide which (if any) of the proposals should go ahead with using -P
Clear and concise description of the problem
The supported package managers allow for the installation of only production dependencies. This is usually motivated by a desire for a smaller deployment footprint.
Since
ni
already supports the "mirror"-D
flag for installing only development dependencies, I propose adding the-P
flag for installing only production dependencies.Suggested solution
I suggest adding the
-P
flag to theni
command, which should instruct agents to install only production dependencies (as defined by the agent). I am happy to provide a PR for it.Alternative
No response
Additional context
There are two things worth pointing out, and they may both trigger a change in antfu-collective/package-manager-detector.
nci
a.k.a.ni --frozen
) with-P
flag, but that would require a changefrozen
command in antfu-collective/package-manager-detector to accept a parameter. This is my ultimate motivation for the change.npm
have deprecated--production
flag, and will print a warning suggesting using--omit=dev
. My current PR uses the new (--omit=dev
) flag. If we want to support--production
flag for older versions (I believe v6 and prior) of npm that do not support--omit
we would need to make a change in antfu-collective/package-manager-detector to support that.If you're up for making these changes, I'd happily provide PRs for them.
Validations
The text was updated successfully, but these errors were encountered: