polyfill-io-loader
polyfill-io-loader copied to clipboard
Better handling polyfills without a detector
Hi,
First of all, thank you for creating this loader. This library is greatly underrated since It's really the only good solution for polyfiling.
Here is one issue I have with it:
When I generate the string with polyfills like this: npx create-polyfill-service-url analyse --file dist/main.js
and use this string as is in your loader, it errors out since some polyfills do not have a detector code.
My proposed solution:
- do not error out on polyfills without a detector.
- if the polyfill.io is contacted with at least a single polyfill, add all the polyfills without a detector to the polyfills list string.
This solution would solve two problems:
- I could use the string generated with
npx create-polyfill-service
as is, without removing polyfills one by one. - greatly improve the chances of polyfilling all polyfills in older browsers. (so even polyfills without a detector code would get polyfilled)
As I said before, this library deserves much more stars / downloads and I believe its the best solution for polyfilling. If I would create a PR for this would you be willing to merge it?
Thank you