browserslist 4.14.0 → 4.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/README.md +45 -3
- package/node.js +4 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -70,6 +70,7 @@ Browserslist will take queries from tool option,
|
|
|
70
70
|
|
|
71
71
|
* [Tools](#tools)
|
|
72
72
|
* [Best Practices](#best-practices)
|
|
73
|
+
* [Browsers Data Updating](#browsers-data-updating)
|
|
73
74
|
* [Queries](#queries)
|
|
74
75
|
* [Query Composition](#query-composition)
|
|
75
76
|
* [Full List](#full-list)
|
|
@@ -143,6 +144,46 @@ Browserslist will take queries from tool option,
|
|
|
143
144
|
and desktop Safari combined.
|
|
144
145
|
|
|
145
146
|
|
|
147
|
+
## Browsers Data Updating
|
|
148
|
+
|
|
149
|
+
`npx browserslist@latest --update-db` updates `caniuse-lite` version
|
|
150
|
+
in your npm, yarn or pnpm lock file.
|
|
151
|
+
|
|
152
|
+
You need to do it regularly for two reasons:
|
|
153
|
+
|
|
154
|
+
1. To use the latest browser’s versions and statistics in queries like
|
|
155
|
+
`last 2 versions` or `>1%`. For example, if you created your project
|
|
156
|
+
2 years ago and did not update your dependencies, `last 1 version`
|
|
157
|
+
will return 2 year old browsers.
|
|
158
|
+
2. `caiuse-lite` deduplication: to synchronize version in different tools.
|
|
159
|
+
|
|
160
|
+
> What is deduplication?
|
|
161
|
+
|
|
162
|
+
Due to how npm architecture is setup, you may have a situation
|
|
163
|
+
where you have multiple versions of a single dependency required.
|
|
164
|
+
|
|
165
|
+
Imagine you begin a project, and you add `autoprefixer` as a dependency.
|
|
166
|
+
npm looks for the latest `caniuse-lite` version (1.0.30000700) and adds it to
|
|
167
|
+
`package-lock.json` under `autoprefixer` dependencies.
|
|
168
|
+
|
|
169
|
+
A year later, you decide to add Babel. At this moment, we have a
|
|
170
|
+
new version of `canuse-lite` (1.0.30000900). npm took the latest version
|
|
171
|
+
and added it to your lock file under `@babel/preset-env` dependencies.
|
|
172
|
+
|
|
173
|
+
Now your lock file looks like this:
|
|
174
|
+
|
|
175
|
+
```ocaml
|
|
176
|
+
autoprefixer 7.1.4
|
|
177
|
+
browserslist 3.1.1
|
|
178
|
+
caniuse-lite 1.0.30000700
|
|
179
|
+
@babel/preset-env 7.10.0
|
|
180
|
+
browserslist 4.13.0
|
|
181
|
+
caniuse-lite 1.0.30000900
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
As you can see, we now have two versions of `caniuse-lite` installed.
|
|
185
|
+
|
|
186
|
+
|
|
146
187
|
## Queries
|
|
147
188
|
|
|
148
189
|
Browserslist will use browsers and Node.js versions query
|
|
@@ -354,10 +395,11 @@ naming or prefixing the module with `@scope/browserslist-config`, such as
|
|
|
354
395
|
`@scope/browserslist-config` or `@scope/browserslist-config-mycompany`.
|
|
355
396
|
|
|
356
397
|
If you don’t accept Browserslist queries from users, you can disable the
|
|
357
|
-
validation by using the `
|
|
398
|
+
validation by using the or `BROWSERSLIST_DANGEROUS_EXTEND` environment variable
|
|
399
|
+
or `dangerousExtend` option.
|
|
358
400
|
|
|
359
|
-
```
|
|
360
|
-
|
|
401
|
+
```sh
|
|
402
|
+
BROWSERSLIST_DANGEROUS_EXTEND=1 npx webpack
|
|
361
403
|
```
|
|
362
404
|
|
|
363
405
|
Because this uses `npm`'s resolution, you can also reference specific files
|
package/node.js
CHANGED
|
@@ -372,7 +372,10 @@ module.exports = {
|
|
|
372
372
|
if (latest !== 0 && latest < halfYearAgo) {
|
|
373
373
|
console.warn(
|
|
374
374
|
'Browserslist: caniuse-lite is outdated. Please run:\n' +
|
|
375
|
-
'npx browserslist@latest --update-db'
|
|
375
|
+
'npx browserslist@latest --update-db\n' +
|
|
376
|
+
'\n' +
|
|
377
|
+
'Why you should do it regularly:\n' +
|
|
378
|
+
'https://github.com/browserslist/browserslist#browsers-data-updating'
|
|
376
379
|
)
|
|
377
380
|
}
|
|
378
381
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "browserslist",
|
|
3
|
-
"version": "4.14.
|
|
3
|
+
"version": "4.14.1",
|
|
4
4
|
"description": "Share target browsers between different front-end tools, like Autoprefixer, Stylelint and babel-env-preset",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"caniuse",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"repository": "browserslist/browserslist",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"caniuse-lite": "^1.0.
|
|
19
|
-
"electron-to-chromium": "^1.3.
|
|
18
|
+
"caniuse-lite": "^1.0.30001124",
|
|
19
|
+
"electron-to-chromium": "^1.3.562",
|
|
20
20
|
"escalade": "^3.0.2",
|
|
21
21
|
"node-releases": "^1.1.60"
|
|
22
22
|
},
|