Build react-native-web using @babel/runtime

Share babel helpers across files. Reduces flat bundle size by 30K
minified and 3K gzipped.
This commit is contained in:
Nicolas Gallagher
2022-07-02 12:01:06 -07:00
parent f81095442f
commit b704844ca7
4 changed files with 5841 additions and 5686 deletions
+7 -1
View File
@@ -43,7 +43,13 @@ module.exports = function (api) {
['babel-plugin-transform-react-remove-prop-types', { mode: 'wrap' }],
['@babel/plugin-proposal-class-properties', { loose: true }],
['@babel/plugin-proposal-object-rest-spread', { useBuiltIns: true }],
'@babel/plugin-proposal-nullish-coalescing-operator'
'@babel/plugin-proposal-nullish-coalescing-operator',
[
'@babel/plugin-transform-runtime',
{
version: '7.18.6'
}
]
].concat(modules ? ['babel-plugin-add-module-exports'] : [])
};
};
+1 -1
View File
@@ -35,7 +35,7 @@
"@babel/plugin-proposal-class-properties": "^7.12.13",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.13",
"@babel/plugin-proposal-object-rest-spread": "^7.12.13",
"@babel/plugin-transform-runtime": "^7.12.15",
"@babel/plugin-transform-runtime": "^7.18.6",
"@babel/preset-env": "^7.12.13",
"@babel/preset-flow": "^7.12.13",
"@babel/preset-react": "^7.12.13",
+1
View File
@@ -14,6 +14,7 @@
"!**/__tests__"
],
"dependencies": {
"@babel/runtime": "^7.18.6",
"create-react-class": "^15.7.0",
"fbjs": "^3.0.0",
"inline-style-prefixer": "^6.0.0",
+5832 -5684
View File
File diff suppressed because it is too large Load Diff