evanw / esbuild

An extremely fast bundler for the web
https://esbuild.github.io/
MIT License
38.22k stars 1.16k forks source link

Feature Request: Support for registry Configuration #3938

Closed elrrrrrrr closed 1 month ago

elrrrrrrr commented 1 month ago

I've noticed from the recent changes that esbuild has stopped supporting the registry configuration, which previously was able to recognize the npm_config_registry environment variable. This feature was quite useful for many users who work with private registries or need to specify a custom registry.

I've seen the discussion in issue #291, and I understand that there might be concerns about the complexity it adds to the build process. However, I believe the benefits outweigh the potential drawbacks, and it would be a valuable addition to the tool. 🙏🏻

evanw commented 1 month ago

The way that this is supposed to work now is that esbuild just invokes npm directly instead of emulating it, and the npm command is supposed to handle everything including the npm_config_registry environment variable. This has been the case for quite some time now. You're linking to a very old issue from before esbuild started doing that (which was in version 0.6.28, not long after the issue you're referencing was closed). So this should already be working.

If you have a bug report for esbuild, then please provide reproduction instructions.

elrrrrrrr commented 1 month ago

😯 I've noticed that the process installUsingNPM is executed first, and only if it fails will the process downloadDirectlyFromNPM continue. Thanks for the reply.