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

Ignore peer dependencies #13

Closed
intrnl opened this issue Dec 15, 2021 · 3 comments
Closed

Ignore peer dependencies #13

intrnl opened this issue Dec 15, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@intrnl
Copy link

intrnl commented Dec 15, 2021

There should be a way to make some imports externalized (in this case, peer dependencies). With how it is right now, it doesn't seem to be a good way to measure how well your library gets bundled.

@okikio
Copy link
Owner

okikio commented Dec 15, 2021

Unfortunately, yeah, you are correct, I'll see if I can find a better way to do this, but for now what I'd suggest doing is using https://esm.sh. It has the ability to set dependencies https://esm.sh/#specify-external-dependencies, e.g. so, if you wanted to bundle swr with a different version of react, you can use esm:swr?deps=react@16.14.0 -> https://bundle.js.org/?q=esm:swr?deps=react@16.14.0&bundle

Open Bundle

@okikio okikio self-assigned this Dec 15, 2021
@okikio okikio added the enhancement New feature or request label Dec 15, 2021
@okikio okikio closed this as completed Dec 16, 2021
@okikio
Copy link
Owner

okikio commented Mar 13, 2022

You can now make deps external via the esbuild config

@okikio
Copy link
Owner

okikio commented Mar 20, 2022

@intrnl Aliases and external packages are now officially supported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants