【问题标题】:React-Native Expo Export Web Receiving Error 'Invalid Project Root' While Building Production App构建生产应用程序时 React-Native Expo 导出 Web 接收错误 \'Invalid Project Root\'
【发布时间】: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


    【解决方案1】:

    这是解决了吗?我现在有同样的问题。

    【讨论】:

      猜你喜欢
      • 2022-01-13
      • 2017-12-09
      • 2020-06-10
      • 2020-05-24
      • 2022-01-15
      • 2022-11-17
      • 2023-02-25
      • 2020-12-06
      • 1970-01-01
      相关资源
      最近更新 更多