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

Would love a way to silence the "indirect calls to require" warnings for 3rd party dependencies #1142

Closed
lgandecki opened this issue Apr 12, 2021 · 4 comments

Comments

@lgandecki
Copy link

I understand that I can silent the warnings with try catch around a require, but that's not really a solution when the require is in node_modules and it's a dependency of one of my dependencies. I guess I can try to require my dependency instead of import it, but then I'm losing TypeScript types and all in all it is a bit silly :)
I would love to be able to "acknowledge" warnings, if I see a new one, I'd investigate and check whether it might be an issue or not, if it's not an issue, I want to silence it (an array of packages to silence is one option that comes to mind).

Did anyone find a nice way to deal with that?

BTW: great job on this package, the speed improvement and the different workflow that this enables is mind-blowing. Thanks!

@evanw
Copy link
Owner

evanw commented Apr 12, 2021

You can disable the printing of warnings by setting the logLevel setting to error in esbuild's API. If you would still like to see certain warnings, you can print them yourself by iterating over the warnings array returned from esbuild's API. If you would like to pretty-print the warnings using esbuild's log style, you can call the formatMessages API.

@evanw
Copy link
Owner

evanw commented Apr 15, 2021

Closing this issue as I have now completely removed the warning in #1155.

@evanw evanw closed this as completed Apr 15, 2021
@lgandecki
Copy link
Author

ok, interesting approach. but is there a chance to SEE those warning? One of the warnings did help me to fix my build, it would be super hard to figure out without that.

@evanw
Copy link
Owner

evanw commented Apr 17, 2021

With the latest release, you can now opt-in to seeing some of these messages that you could have seen previously (along with some additional ones) with --log-level=debug.

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