Skip to content

Commit 524bdc8

Browse files
committed
target modern-er browsers
1 parent 511202f commit 524bdc8

File tree

3 files changed

+37
-14
lines changed

3 files changed

+37
-14
lines changed

.babelrc.js

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
module.exports = (api) => {
2-
api.cache.never();
3-
4-
const envOptions = {
5-
modules: false,
6-
loose: true,
7-
};
8-
9-
if (process.env.NODE_ENV === 'test') {
10-
envOptions.modules = 'commonjs';
11-
envOptions.targets = { node: 'current' };
12-
}
2+
const isTest = api.caller((caller) => caller.name === '@babel/register');
133

144
return {
5+
targets: isTest ? { node: 'current' } : {},
156
presets: [
16-
['@babel/env', envOptions],
7+
['@babel/env', {
8+
modules: isTest ? 'commonjs' : false,
9+
}],
1710
'@babel/react',
1811
],
1912
};

.browserslistrc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
and_chr 92
2+
and_chr 91
3+
and_ff 90
4+
and_ff 89
5+
and_qq 10.4
6+
and_uc 12.12
7+
android 92
8+
android 91
9+
baidu 7.12
10+
chrome 92
11+
chrome 91
12+
chrome 90
13+
edge 92
14+
edge 91
15+
firefox 90
16+
firefox 89
17+
firefox 78
18+
ios_saf 14.5-14.7
19+
ios_saf 14.0-14.4
20+
ios_saf 13.4-13.7
21+
kaios 2.5
22+
op_mini all
23+
op_mob 77
24+
op_mob 76
25+
opera 77
26+
opera 76
27+
safari 14.1
28+
safari 14
29+
samsung 14.0
30+
samsung 13.0

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"@babel/preset-react": "^7.8.3",
1919
"@babel/register": "^7.8.3",
2020
"@rollup/plugin-babel": "^5.0.4",
21-
"cross-env": "^7.0.0",
2221
"eslint": "^7.4.0",
2322
"eslint-config-airbnb": "^18.2.0",
2423
"eslint-plugin-import": "^2.22.0",
@@ -67,9 +66,10 @@
6766
"docs": "prop-types-table src/index.js | md-insert README.md --header Props -i",
6867
"example": "npm run -w example build && npm run -w example start",
6968
"prepare": "npm run build",
69+
"browserslist": "npx browserslist --mobile-to-desktop '> 0.5%, last 2 versions, Firefox ESR, not dead, not IE 11' > .browserslistrc",
7070
"test": "npm run test:types && npm run test:mocha && npm run test:lint",
7171
"test:lint": "eslint --cache --fix .",
72-
"test:mocha": "cross-env NODE_ENV=test mocha --require @babel/register test/*.js",
72+
"test:mocha": "mocha --require @babel/register test/*.js",
7373
"test:types": "tsd"
7474
},
7575
"workspaces": {

0 commit comments

Comments
 (0)