【发布时间】:2022-09-30 16:23:57
【问题描述】:
您好我收到项目根目录无效的错误。我还要补充一点,我正在与我的项目一起使用 expo。
执行命令时会发生这种情况npx 博览会出口:网络
执行命令时也会发生npx 博览会构建
webpack.config.js
module.exports = function (api) {
api.cache(true);
return {
presets: [\"babel-preset-expo\"],
plugins: [\"react-native-reanimated/plugin\"],
};
};
Metro.config.js (不确定地铁是否相关,因为我认为它更多地用于发展目的......)
const { getDefaultConfig } = require(\"@expo/metro-config\");
const defaultConfig = getDefaultConfig(__dirname);
defaultConfig.resolver.assetExts.push(\"cjs\");
module.exports = defaultConfig;
react-native.config.js
module.exports = {
project: {
ios: {},
android: {}, // grouped into \"project\"
web: {},
},
assets: [\"./assets/fonts\"], // stays the same
};
npm 开始工作正常,一切都在浏览器中相应地工作。目标是为生产构建它并开始在 Web 服务器上托管。
我希望我只是缺少配置文件中目录的位置,但任何见解都值得赞赏。
标签: react-native build babeljs