1 | # Browserslist [![Cult Of Martians][cult-img]][cult]
|
2 |
|
3 | <img width="120" height="120" alt="Browserslist logo by Anton Lovchikov"
|
4 | src="https://browserslist.github.io/browserslist/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 | ```js
|
21 | "browserslist": [
|
22 | "defaults",
|
23 | "not IE 11",
|
24 | "not IE_Mob 11",
|
25 | "maintained node versions",
|
26 | ]
|
27 | ```
|
28 |
|
29 | Or in `.browserslistrc` config:
|
30 |
|
31 | ```yaml
|
32 | # Browsers that we support
|
33 |
|
34 | defaults
|
35 | not IE 11
|
36 | not IE_Mob 11
|
37 | maintained node versions
|
38 | ```
|
39 |
|
40 | Developers set their version lists using queries like `last 2 versions`
|
41 | to be free from updating versions manually.
|
42 | Browserslist will use [`caniuse-lite`] with [Can I Use] data for this queries.
|
43 |
|
44 | Browserslist will take queries from tool option,
|
45 | `browserslist` config, `.browserslistrc` config,
|
46 | `browserslist` section in `package.json` or environment variables.
|
47 |
|
48 | [Browserslist Example] shows how every tool uses Browserslist.
|
49 |
|
50 | [cult-img]: https://cultofmartians.com/assets/badges/badge.svg
|
51 | [cult]: https://cultofmartians.com/done.html
|
52 |
|
53 | <a href="https://evilmartians.com/?utm_source=browserslist">
|
54 | <img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg"
|
55 | alt="Sponsored by Evil Martians" width="236" height="54">
|
56 | </a>
|
57 |
|
58 | [stylelint-no-unsupported-browser-features]: https://github.com/ismay/stylelint-no-unsupported-browser-features
|
59 | [eslint-plugin-compat]: https://github.com/amilajack/eslint-plugin-compat
|
60 | [Browserslist Example]: https://github.com/browserslist/browserslist-example
|
61 | [postcss-preset-env]: https://github.com/jonathantneal/postcss-preset-env
|
62 | [postcss-normalize]: https://github.com/jonathantneal/postcss-normalize
|
63 | [`caniuse-lite`]: https://github.com/ben-eb/caniuse-lite
|
64 | [Autoprefixer]: https://github.com/postcss/autoprefixer
|
65 | [Can I Use]: https://caniuse.com/
|
66 | [Babel]: https://github.com/babel/babel/tree/master/packages/babel-preset-env
|
67 | [obsolete-webpack-plugin]: https://github.com/ElemeFE/obsolete-webpack-plugin
|
68 |
|
69 | ## Table of Contents
|
70 |
|
71 | 1. [Tools](#tools)
|
72 | 2. [Best Practices](#best-practices)
|
73 | 3. [Queries](#queries)
|
74 | 4. [Config File](#config-file)
|
75 | 5. [Shareable Configs](#shareable-configs)
|
76 | 6. [Configuring for Different Environments](#configuring-for-different-environments)
|
77 | 7. [Custom Usage Data](#custom-usage-data)
|
78 | 8. [JS API](#js-api)
|
79 | 9. [Environment Variables](#environment-variables)
|
80 | 10. [Cache](#cache)
|
81 |
|
82 | ## Tools
|
83 |
|
84 | * [`browserl.ist`](https://browserl.ist/) is an online tool to check
|
85 | what browsers will be selected by some query.
|
86 | * [`browserslist-ga`] and [`browserslist-ga-export`] download your website
|
87 | browsers statistics to use it in `> 0.5% in my stats` query.
|
88 | * [`browserslist-useragent-regexp`] compiles Browserslist query to a RegExp
|
89 | to test browser useragent.
|
90 | * [`browserslist-useragent-ruby`] is a Ruby library to checks browser
|
91 | by user agent string to match Browserslist.
|
92 | * [`browserslist-browserstack`] runs BrowserStack tests for all browsers
|
93 | in Browserslist config.
|
94 | * [`browserslist-adobe-analytics`] use Adobe Analytics data to target browsers.
|
95 | * [`caniuse-api`] returns browsers which support some specific feature.
|
96 | * Run `npx browserslist` in your project directory to see project’s
|
97 | target browsers. This CLI tool is built-in and available in any project
|
98 | with Autoprefixer.
|
99 |
|
100 | [`browserslist-useragent-regexp`]: https://github.com/browserslist/browserslist-useragent-regexp
|
101 | [`browserslist-adobe-analytics`]: https://github.com/xeroxinteractive/browserslist-adobe-analytics
|
102 | [`browserslist-useragent-ruby`]: https://github.com/browserslist/browserslist-useragent-ruby
|
103 | [`browserslist-browserstack`]: https://github.com/xeroxinteractive/browserslist-browserstack
|
104 | [`browserslist-ga-export`]: https://github.com/browserslist/browserslist-ga-export
|
105 | [`browserslist-useragent`]: https://github.com/pastelsky/browserslist-useragent
|
106 | [`browserslist-ga`]: https://github.com/browserslist/browserslist-ga
|
107 | [`caniuse-api`]: https://github.com/Nyalab/caniuse-api
|
108 |
|
109 |
|
110 | ## Best Practices
|
111 |
|
112 | * There is a `defaults` query, which gives a reasonable configuration
|
113 | for most users:
|
114 |
|
115 | ```json
|
116 | "browserslist": [
|
117 | "defaults"
|
118 | ]
|
119 | ```
|
120 |
|
121 | * If you want to change the default set of browsers, we recommend combining
|
122 | `last 2 versions`, `not dead` with a usage number like `> 0.2%`. This is
|
123 | because `last n versions` on its own does not add popular old versions, while
|
124 | only using a percentage above `0.2%` will in the long run make popular
|
125 | browsers even more popular. We might run into a monopoly and stagnation
|
126 | situation, as we had with Internet Explorer 6. Please use this setting
|
127 | with caution.
|
128 | * Select browsers directly (`last 2 Chrome versions`) only if you are making
|
129 | a web app for a kiosk with one browser. There are a lot of browsers
|
130 | on the market. If you are making general web app you should respect
|
131 | browsers diversity.
|
132 | * Don’t remove browsers just because you don’t know them. Opera Mini has
|
133 | 100 million users in Africa and it is more popular in the global market
|
134 | than Microsoft Edge. Chinese QQ Browsers has more market share than Firefox
|
135 | and desktop Safari combined.
|
136 |
|
137 |
|
138 | ## Queries
|
139 |
|
140 | Browserslist will use browsers and Node.js versions query
|
141 | from one of these sources:
|
142 |
|
143 | 1. `browserslist` key in `package.json` file in current or parent directories.
|
144 | **We recommend this way.**
|
145 | 2. `.browserslistrc` config file in current or parent directories.
|
146 | 3. `browserslist` config file in current or parent directories.
|
147 | 4. `BROWSERSLIST` environment variable.
|
148 | 5. If the above methods did not produce a valid result
|
149 | Browserslist will use defaults:
|
150 | `> 0.5%, last 2 versions, Firefox ESR, not dead`.
|
151 |
|
152 |
|
153 | ### Query Composition
|
154 |
|
155 | An `or` combiner can use the keyword `or` as well as `,`.
|
156 | `last 1 version or > 1%` is equal to `last 1 version, > 1%`.
|
157 |
|
158 | `and` query combinations are also supported to perform an
|
159 | intersection of the previous query: `last 1 version and > 1%`.
|
160 |
|
161 | There is 3 different ways to combine queries as depicted below. First you start
|
162 | with a single query and then we combine the queries to get our final list.
|
163 |
|
164 | Obviously you can *not* start with a `not` combiner, since there is no left-hand
|
165 | side query to combine it with.
|
166 |
|
167 | | Query combiner type | Illustration | Example |
|
168 | | ------------------- | :----------: | ------- |
|
169 | |`or`/`,` combiner <br> (union) | ![Union of queries](img/union.svg) | `> .5% or last 2 versions` <br> `> .5%, last 2 versions` |
|
170 | | `and` combiner <br> (intersection) | ![intersection of queries](img/intersection.svg) | `> .5% and last 2 versions` |
|
171 | | `not` combiner <br> (relative complement) | ![Relative complement of queries](img/complement.svg) | `> .5% and not last 2 versions` <br> `> .5% or not last 2 versions` <br> `> .5%, not last 2 versions` |
|
172 |
|
173 | _A quick way to test your query is to do `npx browserslist '> 0.5%, not IE 11'`
|
174 | in your terminal._
|
175 |
|
176 |
|
177 | ### Full List
|
178 |
|
179 | You can specify the browser and Node.js versions by queries (case insensitive):
|
180 |
|
181 | * `defaults`: Browserslist’s default browsers
|
182 | (`> 0.5%, last 2 versions, Firefox ESR, not dead`).
|
183 | * `> 5%`: browsers versions selected by global usage statistics.
|
184 | `>=`, `<` and `<=` work too.
|
185 | * `> 5% in US`: uses USA usage statistics. It accepts [two-letter country code].
|
186 | * `> 5% in alt-AS`: uses Asia region usage statistics. List of all region codes
|
187 | can be found at [`caniuse-lite/data/regions`].
|
188 | * `> 5% in my stats`: uses [custom usage data].
|
189 | * `> 5% in browserslist-config-mycompany stats`: uses [custom usage data]
|
190 | from `browserslist-config-mycompany/browserslist-stats.json`.
|
191 | * `cover 99.5%`: most popular browsers that provide coverage.
|
192 | * `cover 99.5% in US`: same as above, with [two-letter country code].
|
193 | * `cover 99.5% in my stats`: uses [custom usage data].
|
194 | * `maintained node versions`: all Node.js versions, which are [still maintained]
|
195 | by Node.js Foundation.
|
196 | * `node 10` and `node 10.4`: selects latest Node.js `10.x.x`
|
197 | or `10.4.x` release.
|
198 | * `current node`: Node.js version used by Browserslist right now.
|
199 | * `extends browserslist-config-mycompany`: take queries from
|
200 | `browserslist-config-mycompany` npm package.
|
201 | * `ie 6-8`: selects an inclusive range of versions.
|
202 | * `Firefox > 20`: versions of Firefox newer than 20.
|
203 | `>=`, `<` and `<=` work too. It also works with Node.js.
|
204 | * `iOS 7`: the iOS browser version 7 directly.
|
205 | * `Firefox ESR`: the latest [Firefox ESR] version.
|
206 | * `PhantomJS 2.1` and `PhantomJS 1.9`: selects Safari versions similar
|
207 | to PhantomJS runtime.
|
208 | * `unreleased versions` or `unreleased Chrome versions`:
|
209 | alpha and beta versions.
|
210 | * `last 2 major versions` or `last 2 iOS major versions`:
|
211 | all minor/patch releases of last 2 major versions.
|
212 | * `since 2015` or `last 2 years`: all versions released since year 2015
|
213 | (also `since 2015-03` and `since 2015-03-10`).
|
214 | * `dead`: browsers without official support or updates for 24 months.
|
215 | Right now it is `IE 10`, `IE_Mob 10`, `BlackBerry 10`, `BlackBerry 7`,
|
216 | `Samsung 4` and `OperaMobile 12.1`.
|
217 | * `last 2 versions`: the last 2 versions for *each* browser.
|
218 | * `last 2 Chrome versions`: the last 2 versions of Chrome browser.
|
219 | * `not ie <= 8`: exclude browsers selected by previous queries.
|
220 |
|
221 | You can add `not ` to any query.
|
222 |
|
223 | [`caniuse-lite/data/regions`]: https://github.com/ben-eb/caniuse-lite/tree/master/data/regions
|
224 | [two-letter country code]: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
|
225 | [custom usage data]: #custom-usage-data
|
226 | [still maintained]: https://github.com/nodejs/Release
|
227 | [Can I Use]: https://caniuse.com/
|
228 |
|
229 |
|
230 | ### Debug
|
231 |
|
232 | Run `npx browserslist` in project directory to see what browsers was selected
|
233 | by your queries.
|
234 |
|
235 | ```sh
|
236 | $ npx browserslist
|
237 | and_chr 61
|
238 | and_ff 56
|
239 | and_qq 1.2
|
240 | and_uc 11.4
|
241 | android 56
|
242 | baidu 7.12
|
243 | bb 10
|
244 | chrome 62
|
245 | edge 16
|
246 | firefox 56
|
247 | ios_saf 11
|
248 | opera 48
|
249 | safari 11
|
250 | samsung 5
|
251 | ```
|
252 |
|
253 |
|
254 | ### Browsers
|
255 |
|
256 | Names are case insensitive:
|
257 |
|
258 | * `Android` for Android WebView.
|
259 | * `Baidu` for Baidu Browser.
|
260 | * `BlackBerry` or `bb` for Blackberry browser.
|
261 | * `Chrome` for Google Chrome.
|
262 | * `ChromeAndroid` or `and_chr` for Chrome for Android
|
263 | * `Edge` for Microsoft Edge.
|
264 | * `Electron` for Electron framework. It will be converted to Chrome version.
|
265 | * `Explorer` or `ie` for Internet Explorer.
|
266 | * `ExplorerMobile` or `ie_mob` for Internet Explorer Mobile.
|
267 | * `Firefox` or `ff` for Mozilla Firefox.
|
268 | * `FirefoxAndroid` or `and_ff` for Firefox for Android.
|
269 | * `iOS` or `ios_saf` for iOS Safari.
|
270 | * `Node` for Node.js.
|
271 | * `Opera` for Opera.
|
272 | * `OperaMini` or `op_mini` for Opera Mini.
|
273 | * `OperaMobile` or `op_mob` for Opera Mobile.
|
274 | * `QQAndroid` or `and_qq` for QQ Browser for Android.
|
275 | * `Safari` for desktop Safari.
|
276 | * `Samsung` for Samsung Internet.
|
277 | * `UCAndroid` or `and_uc` for UC Browser for Android.
|
278 | * `kaios` for KaiOS Browser.
|
279 |
|
280 |
|
281 | ## Config File
|
282 |
|
283 | ### `package.json`
|
284 |
|
285 | If you want to reduce config files in project root, you can specify
|
286 | browsers in `package.json` with `browserslist` key:
|
287 |
|
288 | ```json
|
289 | {
|
290 | "private": true,
|
291 | "dependencies": {
|
292 | "autoprefixer": "^6.5.4"
|
293 | },
|
294 | "browserslist": [
|
295 | "last 1 version",
|
296 | "> 1%",
|
297 | "IE 10"
|
298 | ]
|
299 | }
|
300 | ```
|
301 |
|
302 |
|
303 | ### `.browserslistrc`
|
304 |
|
305 | Separated Browserslist config should be named `.browserslistrc`
|
306 | and have browsers queries split by a new line. Comments starts with `#` symbol:
|
307 |
|
308 | ```yaml
|
309 | # Browsers that we support
|
310 |
|
311 | last 1 version
|
312 | > 1%
|
313 | IE 10 # sorry
|
314 | ```
|
315 |
|
316 | Browserslist will check config in every directory in `path`.
|
317 | So, if tool process `app/styles/main.css`, you can put config to root,
|
318 | `app/` or `app/styles`.
|
319 |
|
320 | You can specify direct path in `BROWSERSLIST_CONFIG` environment variables.
|
321 |
|
322 |
|
323 | ## Shareable Configs
|
324 |
|
325 | You can use the following query to reference an exported Browserslist config
|
326 | from another package:
|
327 |
|
328 | ```json
|
329 | "browserslist": [
|
330 | "extends browserslist-config-mycompany"
|
331 | ]
|
332 | ```
|
333 |
|
334 | For security reasons, external configuration only supports packages that have
|
335 | the `browserslist-config-` prefix. npm scoped packages are also supported, by
|
336 | naming or prefixing the module with `@scope/browserslist-config`, such as
|
337 | `@scope/browserslist-config` or `@scope/browserslist-config-mycompany`.
|
338 |
|
339 | If you don’t accept Browserslist queries from users, you can disable the
|
340 | validation by using the `dangerousExtend` option:
|
341 |
|
342 | ```js
|
343 | browserslist(queries, { path, dangerousExtend: true })
|
344 | ```
|
345 |
|
346 | Because this uses `npm`'s resolution, you can also reference specific files
|
347 | in a package:
|
348 |
|
349 | ```json
|
350 | "browserslist": [
|
351 | "extends browserslist-config-mycompany/desktop",
|
352 | "extends browserslist-config-mycompany/mobile"
|
353 | ]
|
354 | ```
|
355 |
|
356 | When writing a shared Browserslist package, just export an array.
|
357 | `browserslist-config-mycompany/index.js`:
|
358 |
|
359 | ```js
|
360 | module.exports = [
|
361 | 'last 1 version',
|
362 | '> 1%',
|
363 | 'ie 10'
|
364 | ]
|
365 | ```
|
366 |
|
367 | You can also include a `browserslist-stats.json` file as part of your shareable
|
368 | config at the root and query it using `> 5% in browserslist-config-mycompany stats`.
|
369 | It uses the same format as `extends` and the `dangerousExtend` property as above.
|
370 |
|
371 |
|
372 | ## Configuring for Different Environments
|
373 |
|
374 | You can also specify different browser queries for various environments.
|
375 | Browserslist will choose query according to `BROWSERSLIST_ENV` or `NODE_ENV`
|
376 | variables. If none of them is declared, Browserslist will firstly look
|
377 | for `production` queries and then use defaults.
|
378 |
|
379 | In `package.json`:
|
380 |
|
381 | ```js
|
382 | "browserslist": {
|
383 | "production": [
|
384 | "> 1%",
|
385 | "ie 10"
|
386 | ],
|
387 | "modern": [
|
388 | "last 1 chrome version",
|
389 | "last 1 firefox version"
|
390 | ],
|
391 | "ssr": [
|
392 | "node 12"
|
393 | ]
|
394 | }
|
395 | ```
|
396 |
|
397 | In `.browserslistrc` config:
|
398 |
|
399 | ```ini
|
400 | [production]
|
401 | > 1%
|
402 | ie 10
|
403 |
|
404 | [modern]
|
405 | last 1 chrome version
|
406 | last 1 firefox version
|
407 |
|
408 | [ssr]
|
409 | node 12
|
410 | ```
|
411 |
|
412 |
|
413 | ## Custom Usage Data
|
414 |
|
415 | If you have a website, you can query against the usage statistics of your site.
|
416 | [`browserslist-ga`] will ask access to Google Analytics and then generate
|
417 | `browserslist-stats.json`:
|
418 |
|
419 | ```
|
420 | npx browserslist-ga
|
421 | ```
|
422 |
|
423 | Or you can use [`browserslist-ga-export`] to convert Google Analytics data without giving a password for Google account.
|
424 |
|
425 | You can generate usage statistics file by any other method. File format should
|
426 | be like:
|
427 |
|
428 | ```js
|
429 | {
|
430 | "ie": {
|
431 | "6": 0.01,
|
432 | "7": 0.4,
|
433 | "8": 1.5
|
434 | },
|
435 | "chrome": {
|
436 | …
|
437 | },
|
438 | …
|
439 | }
|
440 | ```
|
441 |
|
442 | Note that you can query against your custom usage data while also querying
|
443 | against global or regional data. For example, the query
|
444 | `> 1% in my stats, > 5% in US, 10%` is permitted.
|
445 |
|
446 | [`browserslist-ga-export`]: https://github.com/browserslist/browserslist-ga-export
|
447 | [`browserslist-ga`]: https://github.com/browserslist/browserslist-ga
|
448 | [Can I Use]: https://caniuse.com/
|
449 |
|
450 |
|
451 | ## JS API
|
452 |
|
453 | ```js
|
454 | const browserslist = require('browserslist')
|
455 |
|
456 | // Your CSS/JS build tool code
|
457 | function process (source, opts) {
|
458 | const browsers = browserslist(opts.overrideBrowserslist, {
|
459 | stats: opts.stats,
|
460 | path: opts.file,
|
461 | env: opts.env
|
462 | })
|
463 | // Your code to add features for selected browsers
|
464 | }
|
465 | ```
|
466 |
|
467 | Queries can be a string `"> 1%, IE 10"`
|
468 | or an array `['> 1%', 'IE 10']`.
|
469 |
|
470 | If a query is missing, Browserslist will look for a config file.
|
471 | You can provide a `path` option (that can be a file) to find the config file
|
472 | relatively to it.
|
473 |
|
474 | Options:
|
475 |
|
476 | * `path`: file or a directory path to look for config file. Default is `.`.
|
477 | * `env`: what environment section use from config. Default is `production`.
|
478 | * `stats`: custom usage statistics data.
|
479 | * `config`: path to config if you want to set it manually.
|
480 | * `ignoreUnknownVersions`: do not throw on direct query (like `ie 12`).
|
481 | Default is `false.`
|
482 | * `dangerousExtend`: Disable security checks for `extend` query.
|
483 | Default is `false.`
|
484 | * `mobileToDesktop`: Use desktop browsers if Can I Use doesn’t have data
|
485 | about this mobile version. For instance, Browserslist will return
|
486 | `chrome 20` on `and_chr 20` query (Can I Use has only data only about
|
487 | latest versions of mobile browsers). Default is `false`.
|
488 |
|
489 | For non-JS environment and debug purpose you can use CLI tool:
|
490 |
|
491 | ```sh
|
492 | browserslist "> 1%, IE 10"
|
493 | ```
|
494 |
|
495 | You can get total users coverage for selected browsers by JS API:
|
496 |
|
497 | ```js
|
498 | browserslist.coverage(browserslist('> 1%'))
|
499 | //=> 81.4
|
500 | ```
|
501 |
|
502 | ```js
|
503 | browserslist.coverage(browserslist('> 1% in US'), 'US')
|
504 | //=> 83.1
|
505 | ```
|
506 |
|
507 | ```js
|
508 | browserslist.coverage(browserslist('> 1% in my stats'), 'my stats')
|
509 | //=> 83.1
|
510 | ```
|
511 |
|
512 | ```js
|
513 | browserslist.coverage(browserslist('> 1% in my stats', { stats }), stats)
|
514 | //=> 82.2
|
515 | ```
|
516 |
|
517 | Or by CLI:
|
518 |
|
519 | ```sh
|
520 | $ browserslist --coverage "> 1%"
|
521 | These browsers account for 81.4% of all users globally
|
522 | ```
|
523 |
|
524 | ```sh
|
525 | $ browserslist --coverage=US "> 1% in US"
|
526 | These browsers account for 83.1% of all users in the US
|
527 | ```
|
528 |
|
529 | ```sh
|
530 | $ browserslist --coverage "> 1% in my stats"
|
531 | These browsers account for 83.1% of all users in custom statistics
|
532 | ```
|
533 |
|
534 | ```sh
|
535 | $ browserslist --coverage "> 1% in my stats" --stats=./stats.json
|
536 | These browsers account for 83.1% of all users in custom statistics
|
537 | ```
|
538 |
|
539 |
|
540 | ## Environment Variables
|
541 |
|
542 | If a tool uses Browserslist inside, you can change the Browserslist settings
|
543 | with [environment variables]:
|
544 |
|
545 | * `BROWSERSLIST` with browsers queries.
|
546 |
|
547 | ```sh
|
548 | BROWSERSLIST="> 5%" gulp css
|
549 | ```
|
550 |
|
551 | * `BROWSERSLIST_CONFIG` with path to config file.
|
552 |
|
553 | ```sh
|
554 | BROWSERSLIST_CONFIG=./config/browserslist gulp css
|
555 | ```
|
556 |
|
557 | * `BROWSERSLIST_ENV` with environments string.
|
558 |
|
559 | ```sh
|
560 | BROWSERSLIST_ENV="development" gulp css
|
561 | ```
|
562 |
|
563 | * `BROWSERSLIST_STATS` with path to the custom usage data
|
564 | for `> 1% in my stats` query.
|
565 |
|
566 | ```sh
|
567 | BROWSERSLIST_STATS=./config/usage_data.json gulp css
|
568 | ```
|
569 |
|
570 | * `BROWSERSLIST_DISABLE_CACHE` if you want to disable config reading cache.
|
571 |
|
572 | ```sh
|
573 | BROWSERSLIST_DISABLE_CACHE=1 gulp css
|
574 | ```
|
575 |
|
576 | [environment variables]: https://en.wikipedia.org/wiki/Environment_variable
|
577 |
|
578 |
|
579 | ## Cache
|
580 |
|
581 | Browserslist caches the configuration it reads from `package.json` and
|
582 | `browserslist` files, as well as knowledge about the existence of files,
|
583 | for the duration of the hosting process.
|
584 |
|
585 | To clear these caches, use:
|
586 |
|
587 | ```js
|
588 | browserslist.clearCaches()
|
589 | ```
|
590 |
|
591 | To disable the caching altogether, set the `BROWSERSLIST_DISABLE_CACHE`
|
592 | environment variable.
|
593 |
|
594 |
|
595 | ## Security Contact
|
596 |
|
597 | To report a security vulnerability, please use the [Tidelift security contact].
|
598 | Tidelift will coordinate the fix and disclosure.
|
599 |
|
600 | [Tidelift security contact]: https://tidelift.com/security
|