[Bug]: Opera mobile equated to Opera desktop in preset-env #15711
Labels
i: needs triage
outdated
A closed issue/PR that is archived due to age. Recommended to make a new issue
💻
How are you using Babel?
babel-loader (webpack)
Input code
n/a
Configuration file name
babel.config.js
Configuration
Current and expected behavior
When obtaining targets from
browserslist
,preset-env
seems to select the Opera version based on the minimum of "opera" (Opera desktop) and "op_mob" (Opera mobile for Android). This is not appropriate as they have different release cycles and their version numbers are not in sync.This similar scenario was recently fixed in
browserslist
version 4.21.9, so that a typical "defaults" query would return a valid op_mob version. However, because of Babel's current treatment, equating the two, a target of Opera 73 is selected (latest Opera for Android) instead of Opera 99 (Opera desktop latest). Since the compatibility data is based on Opera desktop, this causes unnecessary extra transpilation.Please see browserslist/browserslist#766 (comment) for greater detail.
Environment
core/preset-env 7.22.5
browserslist 4.21.9
Possible solution
Short term fix would be to ignore op_mob in
browserslist
results.Longer term, consider adding separate compatibility data for op_mob.
Additional context
No response
The text was updated successfully, but these errors were encountered: