Use Browserslist definition as ESBuild targets.
Add the function to the target
field of your esbuild.config.js
:
import getBrowserslistTargets from '@eklingen/esbuild-browserslist'
target: getBrowserslistTargets(),
This will make ESBuild use your .browserslistrc
as the target definition, where possible.
The following browserslist targets are NOT supported:
android
, and_qq
, and_uc
, baidu
, bb
, kaios
, op_mob
and op_mini
.
(for android, choose an equivalent target like "chrome", and for "op_mob" choose an equivalent target like "opera")
The following target versions are NOT supported:
all
and TP
(as in op_mob all
and safari TP
).
The following browserslist targets ARE supported:
chrome
, edge
, firefox
, ie
, opera
, safari
and samsung
.
The following browserlist targets are mapped to equivalents with the same version number:
and_chr
to chrome
, and_ff
to firefox
, ie_mob
to ie
and ios_saf
to safari
.
For minor versions or ranges (like ios_saf 12.1-13.3
), the oldest version specified is used (ios_saf 12
).
For duplicate targets, only the oldest version is used.
This package requires "browserslist".
Copyright (c) 2024 Elco Klingen. MIT License.