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

exclude polyfills for specific dependencies #99

Open
UnCor3 opened this issue Jul 23, 2024 · 2 comments
Open

exclude polyfills for specific dependencies #99

UnCor3 opened this issue Jul 23, 2024 · 2 comments
Labels
question Further information is requested

Comments

@UnCor3
Copy link

UnCor3 commented Jul 23, 2024

Hi there, is there a way to exclude polyfills for a specific dependency ?

I've had issues with a library because it thinks it's running in node due to the process polyfill. In the source code of this repo banners are used to inject the process polyfill and according to esbuild docs there isn't a way to filter which files to inject the banner so i got stuck

So far i've tried

  • Excluding the dependency from optimizeDeps (didnt work because the library has require calls)
  • Doing a dynamic import instead (didn't work)
@davidmyersdev
Copy link
Owner

Sure thing. You can exclude imported polyfills with the exclude option, and you can exclude global polyfills (Buffer, process, or global) with the globals option. Check out this section of the readme.

@davidmyersdev davidmyersdev added the question Further information is requested label Jul 28, 2024
@UnCor3
Copy link
Author

UnCor3 commented Jul 29, 2024

Thanks for responding. I think i got misunderstood. I need the polyfills in some of my dependencies but others do not like it(issue explained in my first comment), is there a way to exclude polyfills file based ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants