Replies: 2 comments 1 reply
-
Babel does not provide ability to disable certain plugin if it is enabled by a preset: https://github.com/facebook/metro/blob/e3c83a85226151dca77689fd86e6763f8bed3f0c/packages/metro-react-native-babel-preset/src/configs/main.js#L122 You can file a feature request to the metro project. Note that Meanwhile, as a workaround, you can extract code containing BigInt exponentiation to a new folder and apply different Babel configs to them. For example
Babel.config.js module.exports = {
overrides: [
{ include: 'src', presets: ['module:metro-react-native-babel-preset'] }
{ include: 'bigint-lib', plugins: [ ... any plugins you need to make it run ] }
]
}; |
Beta Was this translation helpful? Give feedback.
-
I still struggled with this error using Nuxt2 and babel and finally worked with this config: |
Beta Was this translation helpful? Give feedback.
-
I have a react native project that uses babel.config.js. I would like to exclude the plugin babel-plugin-transform-exponentiation-operator because it is converting ** into Math.pow, which I don't want (this is for BigInt). Does anyone have a sample config I can see as whatever I try does not work. Here's my try that does not work and the error I keep getting is Cannot convert a BigInt value to a number.
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
exclude: ['babel-plugin-transform-exponentiation-operator'],
};
Beta Was this translation helpful? Give feedback.
All reactions