oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
71.84k stars 2.56k forks source link

Support for nohoist / multiple versions of the same package #6850

Open michelalbers opened 8 months ago

michelalbers commented 8 months ago

What is the problem this feature would solve?

I have a monorepo with multiple frontends and multiple backend services. Some frontends are at the latest version of React and some are still using an older version. Same goes for the backends - some need older versions of express and some are using the most recent one.

With bun it seems that all dependencies are hoisted to the root and there can only be one version per package available. I would need to circumvent that problem with a nohoist option.

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

Introduce nohoist to give developers more control over specific hoisting needs.

What alternatives have you considered?

Using pnpm which stores the packages with a version tag so there are no clashes. But obviously I want to try bun :)

frankcalise commented 7 months ago

Also experiencing a need for this for a react-native project inside of a monorepo

keverw commented 6 months ago

I'm playing around with Ionic Framework and Capacitor. Looks like it complains if not in there directly even though they have multi-app support. For now my workaround is just to symlink it.