JakeChampion/polyfill-service-url-builder

Build against a given User-Agent/browserlist string?

thom4parisot opened this issue ยท 4 comments

Hello,

I was wondering if there was a plan to add a "browser" option, so as the generated URI is built against a minimum browser version.

I'd like to factor the URI for a given browser (ex: Firefox ESR), instead of having a fully complete set of features listed in the URI (I assume I won't support some deprecated browsers).

# currently I do
$ npx create-polyfill-service-url analyse --file build/bundle.js

# what I wish I could do
$ npx create-polyfill-service-url analyse --file build/bundle.js --browser "firefox-esr"

# dreamlike
$ npx create-polyfill-service-url analyse --file build/bundle.js --browser "firefox-esr,edge,last 2 version,> 10% in FR"

Thank you for your time!

Hey @oncletom, long time no see/speak! I remember working with you in BBC World Service on a Grunt task to automate the internalization of the labels on the website when I was an intern there, I hope you are doing well :-)

Your feature request is a great idea, I've made a pull-request for it #14

๐ŸŽ‰ This issue has been resolved in version 2.0.0 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

Oh hi @JakeChampion ๐Ÿ™‚

It's super nice from you to have taken the time to follow up on this.
Keep up the good work!

Having some trouble with this feature. Here's what I ran:

npx create-polyfill-service-url analyse --file baguetteBox.min.js --browser "IE 11"

Tested my browser string on browserlist.dev. After running the command, I get Unknown argument: browser and browser is not listed in Options after running --help.

Full output if you're curious.


This is a great feature to have! ๐Ÿ‘ for working on it.