英文:
How to add `react-native-reanimated/plugin` to `babel.config.js`?
问题
我正在尝试将react-native-reanimated
从v1.13.3
升级到v2.0.1
。在安装说明中,他们建议在您的babel.config.js
中添加react-native-reanimated/plugin
,如下所示:
module.exports = {
presets: [
...
],
plugins: [
...
'react-native-reanimated/plugin',
],
};
目前我的babel.config.js
如下所示:
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
env: {
production: {
plugins: [
'react-native-paper/babel'
],
},
}
};
如果我像这样添加它:
plugins: [
'react-native-paper/babel'
'react-native-reanimated/plugin'
],
我会收到此错误:Transform's input file does not exist: <project>/node_modules/react-native-reanimated/android/react-native-reanimated-65.aar. (See https://issuetracker.google.com/issues/158753935)
我应该如何替代添加它?
英文:
I'm trying to upgrade react-native-reanimated
from v1.13.3
to v2.0.1
. In the installation instructions they say to add react-native-reanimated/plugin
to your babel.config.js
as follows:
module.exports = {
presets: [
...
],
plugins: [
...
'react-native-reanimated/plugin',
],
};
Currently my babel.config.js
looks like this:
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
env: {
production: {
plugins: [
'react-native-paper/babel'
],
},
}
};
If I add it like this:
plugins: [
'react-native-paper/babel'
'react-native-reanimated/plugin'
],
I get this error: Transform's input file does not exist: <project>/node_modules/react-native-reanimated/android/react-native-reanimated-65.aar. (See https://issuetracker.google.com/issues/158753935)
How should I add it instead?
答案1
得分: 2
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
'react-native-reanimated/plugin',
],
env: {
production: {
plugins: [
'react-native-paper/babel'
],
},
}
};
英文:
You can try:
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
'react-native-reanimated/plugin',
],
env: {
production: {
plugins: [
'react-native-paper/babel'
],
},
}
};
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论