Skip to content

Commit 84f57d0

Browse files
authored
feat: preserve module structure to improve tree-shaking (#1783)
* perf: preserve module structure to improve tree-shaking + other improvements - Replace `rollup-plugin-license` with Rollup’s built-in `option.banner` - Slightly speed up Babel transpilation by targeting `tsx?` files first. * build(babel): simplify config, build for modern browsers * build(browserslist): expand modern browser support, drop rare mobile browsers * build(all components): point pkg.json `module` field to `dist/esm/index.js` * chore: remove unused Babel + Rollup plugins
1 parent b2f9cb8 commit 84f57d0

File tree

28 files changed

+153
-191
lines changed

28 files changed

+153
-191
lines changed

babel.config.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ module.exports = {
1010
[
1111
'@babel/preset-env',
1212
{
13-
targets: '> 0.5%, last 2 versions, Firefox ESR, not dead'
13+
// https://browsersl.ist/#q=%3E+0.3%25%2C+last+2+versions%2C+Firefox+ESR%2C+not+dead%2C+not+and_qq+13-14%2C+not+kaios+2-5
14+
targets: '> 0.3%, last 2 versions, Firefox ESR, not dead, not and_qq 13-14, not kaios 2-5'
15+
}
16+
],
17+
[
18+
'@babel/preset-react',
19+
{
20+
useBuiltIns: true // https://babeljs.io/docs/babel-preset-react#usebuiltins
1421
}
1522
],
16-
'@babel/preset-react',
1723
['@babel/preset-typescript', { onlyRemoveTypeImports: true }]
1824
],
19-
plugins: [
20-
'@babel/plugin-transform-object-assign',
21-
['@babel/plugin-transform-class-properties', { loose: true }],
22-
'babel-plugin-styled-components',
23-
['@babel/plugin-transform-private-property-in-object', { loose: true }],
24-
['@babel/plugin-transform-private-methods', { loose: true }]
25-
],
25+
plugins: ['babel-plugin-styled-components'],
2626
env: {
2727
production: {
2828
plugins: [['react-remove-properties', { properties: [/data-test/u] }]]

package-lock.json

Lines changed: 98 additions & 140 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)