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

Dynamic require in CJS format require() tries to load glob #3353

Closed
privatenumber opened this issue Aug 28, 2023 · 1 comment
Closed

Dynamic require in CJS format require() tries to load glob #3353

privatenumber opened this issue Aug 28, 2023 · 1 comment

Comments

@privatenumber
Copy link
Contributor

privatenumber commented Aug 28, 2023

In v0.19, transforming a dynamic require(`./${variable}`) with the cjs format leads to unexpected code:

  1. It requires a glob: **/*
  2. It assigns it to import__ which is never used
  3. It references globRequrie which is never defined

v0.19.2

https://esbuild.github.io/try/#dAAwLjE5LjIAewogIGZvcm1hdDogJ2NqcycsCn0AY29uc3QgeCA9ICdhLmpzJzsKcmVxdWlyZShgLi8ke3h9YCk7

v0.18.20 - working expectedly

https://esbuild.github.io/try/#dAAwLjE4LjIwAHsKICBmb3JtYXQ6ICdjanMnLAp9AGNvbnN0IHggPSAnYS5qcyc7CnJlcXVpcmUoYC4vJHt4fWApOw

@privatenumber
Copy link
Contributor Author

This was resolved via 00c4ebe (#3546).

Thanks!

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

1 participant