Skip to content

Commit 77d571a

Browse files
committed
feat: Improve output code size and do not package tests
BREAKING CHANGE: The package now does use `Object.assign` directly instead of babel helpers. In older browsers you need to pollyfill `Object.assign` and `Symbol`. `react` itself has the same requirements, see https://reactjs.org/docs/javascript-environment-requirements.html BREAKING CHANGE: Tests are not shipped anymore with the npm package.
1 parent e1682a8 commit 77d571a

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

.babelrc.js

+22-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,28 @@ const modules = output == null ? false : output;
88
const targets = env === 'test' ? { node: 'current' } : undefined;
99

1010
const options = {
11-
presets: [['@babel/env', { loose: true, modules, targets }], '@babel/react'],
11+
assumptions: {
12+
ignoreToPrimitiveHint: true,
13+
iterableIsArray: true,
14+
mutableTemplateObject: true,
15+
noNewArrows: true,
16+
objectRestNoSymbols: true,
17+
setComputedProperties: true,
18+
setSpreadProperties: true,
19+
},
20+
presets: [
21+
[
22+
'@babel/env',
23+
{
24+
loose: true,
25+
modules,
26+
targets,
27+
corejs: '3',
28+
useBuiltIns: 'entry',
29+
},
30+
],
31+
['@babel/react', { useBuiltIns: true }],
32+
],
1233
plugins: [],
1334
};
1435

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@
3636
"esm",
3737
"lib",
3838
"style",
39-
"src"
39+
"src/*.js",
40+
"src/components/*.js",
41+
"src/helpers/*.js"
4042
],
4143
"homepage": "https://github.com/reactjs/react-tabs",
4244
"keywords": [

0 commit comments

Comments
 (0)