How to list the supported browsers?

The CLI docs briefly cover Build Targets https://guides.emberjs.com/v3.20.0/configuring-ember/build-targets/ and mentions that the feature is backed by https://github.com/ai/browserslist

According to the browserslist documentation https://github.com/browserslist/browserslist#debug running npx browserslist will generate a list of browsers that are supported. However, this does not work for an Ember app due to Ember not declaring targets in a default/standard Browserslist config location.

Is there a way to generate the list of browsers using ember?

You can pull the browser queries out of config/targets.js and pass them into browserslist. Using zsh, I see this works:

npx browserslist "`node -e "console.log(require('./config/targets.js').browsers.join(','))"`"
2 Likes

Thank you, that works wonderfully. I have add the code to a shell script called “ember-browser-list” to make it easier to use for others on my team.