bun icon indicating copy to clipboard operation
bun copied to clipboard

Should be able to exempt a package from `external`

Open steveluscher opened this issue 5 months ago • 0 comments

What is the problem this feature would solve?

Most of the time you want to extern all packages; "packages": "external" lets you do that.

Sometimes you want to extern all packages except for one or more.

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

Let "external" take negative patterns, that take precedence over "packages".

{
  "external": ["!@solana/text-encoding-impl"],
  "packages": "external"
}

That config would result in all packages except for @solana/text-encoding-impl being marked as external. @solana/text-encoding-impl would be inlined into the bundle.

What alternatives have you considered?

Don't use "packages". Walk the package.json, collect all of the dependencies, and put them manually into "external", except for the one(s) I don't want.

steveluscher avatar Jun 13 '25 22:06 steveluscher