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

Import node_modules together with --external causes import renames #3231

Closed
Patrick-clone opened this issue Jul 13, 2023 · 2 comments
Closed

Comments

@Patrick-clone
Copy link

I'm using and importing a node module in multiple files like this import { Foo } from '@foo';. But when I build and say --external:@foo there are multiple import statements in the bundled out file like this: import { Foo as Foo2} from '@foo'.

I've seen this issue, but it does not make sense to me how this is the default behavior. This is a very common use case is it not? Importing node modules in multiple part of your code base and excluding them from the bundle because in production you load the node module through a <script> tag or something like that.

Is this something that is possible with esbuild?

@evanw
Copy link
Owner

evanw commented Jul 13, 2023

I think this issue is a duplicate of #475. This is harmless except for a slight size increase in the resulting code.

@Patrick-clone
Copy link
Author

Thank you for the quick response and the link. I could not find this issue.
I will close this issue.

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

2 participants