What is @babel/compat-data?
The @babel/compat-data package provides data about the environment features that Babel can target. It includes information about browser and JavaScript engine versions that support various ECMAScript features. This data is used by Babel to determine which transformations and polyfills are necessary for a given target environment.
What are @babel/compat-data's main functionalities?
Environment Data Retrieval
Retrieve compatibility data for the last two versions of browsers. This is used in Babel's preset-env to determine which transformations/polyfills are needed.
"last 2 versions"
Specific Feature Data
Get data about a specific ECMAScript feature, such as arrow functions, to see which environments support it natively.
"es6.arrow-functions"
Other packages similar to @babel/compat-data
core-js-compat
Provides compatibility data for core-js, a library that includes polyfills for ECMAScript features. It is similar to @babel/compat-data but focuses on the features polyfilled by core-js.
caniuse-lite
A lighter version of caniuse-db, containing browser support tables for front-end technologies. It is similar to @babel/compat-data in that it provides compatibility data, but it is more general and not specific to Babel's needs.
browserslist
A tool for sharing target browsers and Node.js versions between different front-end tools. It is similar to @babel/compat-data in that it helps determine which environments to target, but it does not provide specific feature support data.
@babel/compat-data
The compat-data to determine required Babel plugins
See our website @babel/compat-data for more information.
Install
Using npm:
npm install --save @babel/compat-data
or using yarn:
yarn add @babel/compat-data