我想通过expo在react本机管理的流程中使用TensorFlow。当我使用插件桥时,我在android上运行时收到一个错误,即babel需要将@babel/ https://github.com/tensorflow/tfjs/tree/master/tfjs-react-native -transform-typescript的选项allowNamespaces设置为true。
因此我将babel.config.js更改为:
module.exports = function(api) {
api.cache(true);
return {
presets: ["babel-preset-expo"],
plugins: [
"@babel/plugin-transform-typescript",
{
allowNamespaces: true
}
]
};
};
但是现在我得到了错误Error: [BABEL] /node_modules/expo/AppEntry.js: .allowNamespaces is not a valid Plugin property
,所以它在请求中添加了点。
我试着把它放到.babelrc
中,但还是一样的。你知道怎么解决这个问题吗?谢谢
发布于 2019-12-04 23:22:42
我做了更多的尝试,最后,.babelrc
配置被正确传递:
{
"plugins": [
["@babel/plugin-transform-typescript", { "allowNamespaces": true }]
]
}
https://stackoverflow.com/questions/59162784
复制相似问题