You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
andexcludeModernPolyfills
, both of typestring[]
.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
The text was updated successfully, but these errors were encountered: