Description
Description
When using @vitejs/plugin-legacy
, I can use the auto-detection feature to automatically include the polyfills needed, based on my codebase and my browserslist config.
However, there may be polyfills that I don't want to have included e.g. because I want to use a different polyfill implementation or another dependency / import already provides a polyfill. I don't want to manually specify all the other polyfills but rather have the option to exclude one or more specific polyfills.
As far as I have seen, including such a feature would not be difficult to implement, thus I intend to provide a PR with a try in the near future.
Suggested solution
Two new options excludeLegacyPolyfills
and excludeModernPolyfills
, both of type string[]
.
Before creating the chunks, designated polyfills are filtered to remove the polyfills passed in options.
Alternatively, a single option excludePolyfills
could also do the job but in my eyes, it is reasonable to stick to the seperated configuration between legacy and modern.
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.