Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config externals shortcut #65

Open
flamrdevs opened this issue Dec 27, 2023 · 3 comments
Open

Config externals shortcut #65

flamrdevs opened this issue Dec 27, 2023 · 3 comments
Assignees

Comments

@flamrdevs
Copy link

Is there a config shortcut to auto externals dependencies / peerDependencies?

Something like this

{
  "esbuild": {
    "external": "auto",
  }
}
@okikio
Copy link
Owner

okikio commented Dec 27, 2023

Unfortunately there currently isn't, but I'll look into adding it

@szhsin
Copy link

szhsin commented Jun 7, 2024

Hey @okikio , first of all thanks for the amazing work.

It would great if we can automatically add peerDependencies in the npm package.json into esbuild.external config.

For example, an React UI npm package usually has "react" and "react-dom" as peer dependencies, in the default config we should have:

{
  "esbuild": {
    "external": ["react", "react-dom"]
  }
}

@okikio
Copy link
Owner

okikio commented Jun 10, 2024

@szhsin I'm hesitant to enable that by default for react, as people still check the raw bundle size of react, but what I will do instead is support an auto option that automatically marks peerDeps as external.

Sorry @flamrdevs I forgot to enable this feature last year, I'll be enabling later this week.

@okikio okikio self-assigned this Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@okikio @szhsin @flamrdevs and others