webpack: browserslist target throws when Babel can understand it

Bug report

What is the current behavior?

Using the following .browserslistrc that was generated a few weeks back with npx browserslist --mobile-to-desktop "> 0.5%, last 2 versions, Firefox ESR, not dead, not IE 11" throws.

and_chr 91
and_ff 89
and_qq 10.4
and_uc 12.12
android 91
baidu 7.12
chrome 90
edge 91
firefox 78
ios_saf 12.4
kaios 2.5
op_mini all
op_mob 76
opera 76
safari 14
samsung 13.0

If the current behavior is a bug, please provide the steps to reproduce.

$ git clone https://github.com/eps1lon/webpack-targets-browserslist
$ yarn
$ yarn start

What is the expected behavior?

Webpack is able to understand this browserlist since Babel is able to. See https://github.com/babel/babel/issues/12123 for more context.

Other relevant information: webpack version: 5.52.0 Node.js version: 12.22.6 Operating System: Linux 5.4 Ubuntu 20.04.3 LTS (Focal Fossa) Additional tools: browserslist@4.17.0, caniuse-lite@1.0.30001255

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 17 (8 by maintainers)

Most upvoted comments

Because mobileToDesktop is a specific Babel hack. It could leads to compatibility data losses for other tool