-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Description
Description
Generalizing both #10284 and #9896.
Internally, Vite plugin-legacy do bunch of "import ..." per each element in the array of the configuration additionalLegacyPolyfills.
Why not let the user do his own imports? This way, the user has more control about external/internal polyfill setup.
Suggested solution
Let the user define some legacySetupFile in the plugin-legacy configuration, and (optionally) make the additionalLegacyPolyfills configuration deprecated (as the user can write his own import declarations in this file).
Then, the user can enjoy all modern/custom language features of JS, and write a polyfill even in TS.
Vite plugin-legacy will do a regular build to this legacy file, and will prepend all the relevant standard core-JS polyfills needed after the build.
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.