错误消息
在"\project\directory\path.babelrc.env.development“中指定的未知插件”require all\“
我的文件
.babelrc
{
"presets": ["babel-preset-expo"],
"env": {
"development": {
"plugins": ["transform-react-jsx-source", "require-all"]
}
}
}package.json
{
"name": "text-adventure-app",
"version": "0.1.0",
"private": true,
"devDependencies": {
"babel-plugin-require-all": "0.0.1",
"jest-expo": "~27.0.0",
"react-native-scripts": "1.14.0",
"react-test-renderer": "16.3.1"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "jest"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"clear": "^0.1.0",
"create-react-class": "^15.6.3",
"expo": "^27.0.1",
"react": "16.3.1",
"react-native": "~0.55.2",
"react-native-typewriter": "^0.5.3"
}
}巴贝尔-插件-要求-所有
通过npm安装,如下所述:https://github.com/dushaobindoudou/babel-plugin-require-all
我试过什么
发布于 2018-09-02 02:07:22
这个插件在package.json中有一个问题-- main属性中有一个额外的(空间),这意味着babel无法解决它。我通过从行尾删除空格来验证这一点,它成功地编译了。
在这种情况下,我的建议是使用不同的包(可能类似于https://github.com/vihanb/babel-plugin-wildcard ),或者向babel-plugin-require-all包提交一个拉请求,以删除额外的空间。
https://stackoverflow.com/questions/52124755
复制相似问题