bun icon indicating copy to clipboard operation
bun copied to clipboard

Install Dev dependencies

Open nivekcode opened this issue 2 years ago • 1 comments

What is the problem this feature would solve?

npmoffers the possibility to install devDependencies. It seems that bun currently does not offer this feature. All dependencies installed with bun are installed as normal dependencies. It would be great to add the -dflag to bun installso that we can install dependencies as devDependencies.

What is the feature you are proposing to solve the problem?

bun install -d

What alternatives have you considered?

Installing dependency with bun installand manually move them to devDependencies.

nivekcode avatar Dec 19 '22 10:12 nivekcode

Seconding this, I would really like dev dependency support

alexreyes avatar Jan 19 '23 19:01 alexreyes

https://bun.sh/docs/cli/install#add-and-remove-packages

bun add --development @types/react
bun add -d @types/react

valbaca avatar Mar 08 '23 07:03 valbaca

My 2 cents on this

Rest of the ecosystem:

Manager Flags
Yarn@1 / Berry --dev / -D
Npm --save-dev / -D (but also accepts --dev as an internal alias)
Pnpm --save-dev / -D

Bun meanwhile fails for -D and prints out usage for --dev I suggest adding -D/--dev as aliases to --development, to make it so you can use -D in all package managers and --dev (in everything but pnpm)

Example of code used in one of the packages I'm trying to upgrade because of this incompatibility // bun use -d instead of -D, #90

Also I'd love to contribute this change + improve docs (and by docs I mean CLI usage docs that don't mention which flag is used for dev)

Current usage

CleanShot 2023-03-15 at 16 30 26

Zeko369 avatar Mar 15 '23 15:03 Zeko369

Hmm I actually found a PR that implemented this #2240, but it was reverted 🤔 cc: @Jarred-Sumner

Zeko369 avatar Mar 15 '23 18:03 Zeko369

Hmm I actually found a PR that implemented this #2240, but it was reverted 🤔 cc: @Jarred-Sumner

It had to be reverted because it caused other issues with CLI parsing, we will revive the change soon.

Electroid avatar Mar 15 '23 18:03 Electroid

Seems to be a duplicate of #1819, which is resolved.

Parzival-3141 avatar Sep 07 '23 20:09 Parzival-3141