1 | # Browserslist [![Cult Of Martians][cult-img]][cult]
|
2 |
|
3 | <img width="120" height="120" alt="Browserslist logo by Anton Popov"
|
4 | src="https://browsersl.ist/logo.svg" align="right">
|
5 |
|
6 | The config to share target browsers and Node.js versions between different
|
7 | front-end tools. It is used in:
|
8 |
|
9 | * [Autoprefixer]
|
10 | * [Babel]
|
11 | * [postcss-preset-env]
|
12 | * [eslint-plugin-compat]
|
13 | * [stylelint-no-unsupported-browser-features]
|
14 | * [postcss-normalize]
|
15 | * [obsolete-webpack-plugin]
|
16 |
|
17 | All tools will find target browsers automatically,
|
18 | when you add the following to `package.json`:
|
19 |
|
20 | ```json
|
21 | "browserslist": [
|
22 | "defaults and fully supports es6-module",
|
23 | "maintained node versions"
|
24 | ]
|
25 | ```
|
26 |
|
27 | Or in `.browserslistrc` config:
|
28 |
|
29 | ```yaml
|
30 | # Browsers that we support
|
31 |
|
32 | defaults and fully supports es6-module
|
33 | maintained node versions
|
34 | ```
|
35 |
|
36 | Developers set their version lists using queries like `last 2 versions`
|
37 | to be free from updating versions manually.
|
38 | Browserslist will use [`caniuse-lite`] with [Can I Use] data for this queries.
|
39 |
|
40 | You can check how config works at our playground: [`browsersl.ist`](https://browsersl.ist/)
|
41 |
|
42 | <a href="https://browsersl.ist/">
|
43 | <img src="/img/screenshot.webp" alt="browsersl.ist website">
|
44 | </a>
|
45 |
|
46 | <br>
|
47 | <br>
|
48 | <div align="center">
|
49 | <a href="https://evilmartians.com/?utm_source=browserslist"><img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg" alt="Sponsored by Evil Martians" width="236" height="54"></a> <a href="https://cube.dev/?ref=eco-browserslist-github"><img src="https://user-images.githubusercontent.com/986756/154330861-d79ab8ec-aacb-4af8-9e17-1b28f1eccb01.svg" alt="Supported by Cube" width="227" height="46"></a>
|
50 | </div>
|
51 |
|
52 | [stylelint-no-unsupported-browser-features]: https://github.com/ismay/stylelint-no-unsupported-browser-features
|
53 | [obsolete-webpack-plugin]: https://github.com/ElemeFE/obsolete-webpack-plugin
|
54 | [eslint-plugin-compat]: https://github.com/amilajack/eslint-plugin-compat
|
55 | [Browserslist Example]: https://github.com/browserslist/browserslist-example
|
56 | [postcss-preset-env]: https://github.com/csstools/postcss-plugins/tree/main/plugin-packs/postcss-preset-env
|
57 | [postcss-normalize]: https://github.com/csstools/postcss-normalize
|
58 | [`browsersl.ist`]: https://browsersl.ist/
|
59 | [`caniuse-lite`]: https://github.com/ben-eb/caniuse-lite
|
60 | [Autoprefixer]: https://github.com/postcss/autoprefixer
|
61 | [Can I Use]: https://caniuse.com/
|
62 | [Babel]: https://github.com/babel/babel/tree/master/packages/babel-preset-env
|
63 | [cult-img]: https://cultofmartians.com/assets/badges/badge.svg
|
64 | [cult]: https://cultofmartians.com/done.html
|
65 |
|
66 | ## Docs
|
67 | Read full docs **[here](https://github.com/browserslist/browserslist#readme)**.
|