react-native-builder-bob 0.35.1 → 0.35.2
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/babel-config.js +10 -1
- package/babel-preset.js +7 -1
- package/package.json +2 -2
package/babel-config.js
CHANGED
|
@@ -61,7 +61,16 @@ const getConfig = (defaultConfig, { root, pkg }) => {
|
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
63
|
include: path.join(root, src),
|
|
64
|
-
presets: [
|
|
64
|
+
presets: [
|
|
65
|
+
[
|
|
66
|
+
require.resolve('./babel-preset'),
|
|
67
|
+
{
|
|
68
|
+
// Let the app's preset handle the commonjs transform
|
|
69
|
+
// Otherwise this causes `export` statements in wrong places causing syntax error
|
|
70
|
+
supportsStaticESM: true,
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
],
|
|
65
74
|
},
|
|
66
75
|
],
|
|
67
76
|
};
|
package/babel-preset.js
CHANGED
|
@@ -4,10 +4,16 @@ const browserslist = require('browserslist');
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Babel preset for React Native Builder Bob
|
|
7
|
+
*
|
|
8
|
+
* @param {Boolean} options.supportsStaticESM - Whether to preserve ESM imports/exports, defaults to `false`
|
|
9
|
+
* @param {Boolean} options.rewriteImportExtensions - Whether to rewrite import extensions to '.js', defaults to `false`
|
|
10
|
+
* @param {'automatic' | 'classic'} options.jsxRuntime - Which JSX runtime to use, defaults to 'automatic'
|
|
7
11
|
*/
|
|
8
12
|
module.exports = function (api, options, cwd) {
|
|
9
13
|
const opt = (name) =>
|
|
10
|
-
|
|
14
|
+
options[name] !== undefined
|
|
15
|
+
? options[name]
|
|
16
|
+
: api.caller((caller) => (caller != null ? caller[name] : undefined));
|
|
11
17
|
|
|
12
18
|
const supportsStaticESM = opt('supportsStaticESM');
|
|
13
19
|
const rewriteImportExtensions = opt('rewriteImportExtensions');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-builder-bob",
|
|
3
|
-
"version": "0.35.
|
|
3
|
+
"version": "0.35.2",
|
|
4
4
|
"description": "CLI to build JavaScript files for React Native libraries",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"jest": "^29.7.0",
|
|
88
88
|
"mock-fs": "^5.2.0"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "9c5638a224d558071ae01f010da8b7a6860f00ee"
|
|
91
91
|
}
|