This would allow a more logical definition of what is an external package, and what should be included in a bundle
What is the feature you are proposing to solve the problem?
When using bun build --packages external any workspace members should not be externalized. An example is available here: https://github.com/mattfysh/bunpkgsext
packages/a depends on packages/b and lodash - when bundling A with --packages external it externalizes both B and lodash. Because package B is a workspace member and not a third party package, it should not be excluded from the bundle
This would also bring bun in line with esbuild
What alternatives have you considered?
Manually listing each node_module as --external -- too fussy and error prone
Writing a plugin to decide which packages to externalize
What is the problem this feature would solve?
This would allow a more logical definition of what is an external package, and what should be included in a bundle
What is the feature you are proposing to solve the problem?
When using
bun build --packages external
any workspace members should not be externalized. An example is available here: https://github.com/mattfysh/bunpkgsextpackages/a
depends onpackages/b
andlodash
- when bundling A with--packages external
it externalizes both B and lodash. Because package B is a workspace member and not a third party package, it should not be excluded from the bundleThis would also bring bun in line with esbuild
What alternatives have you considered?
--external
-- too fussy and error prone