How to list the supported browsers?

The CLI docs briefly cover Build Targets Build targets - Configuration - Ember Guides and mentions that the feature is backed by GitHub - browserslist/browserslist: πŸ¦” Share target browsers between different front-end tools, like Autoprefixer, Stylelint and babel-preset-env

According to the browserslist documentation GitHub - browserslist/browserslist: πŸ¦” Share target browsers between different front-end tools, like Autoprefixer, Stylelint and babel-preset-env 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?

1 Like

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(','))"`"
5 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.

Very usefull @ef4 , thx :+1: