Aws-Amplify:mark.json和env.json加载index.html [英] Aws-Amplify: manifest.json and env.json loading index.html

查看:18
本文介绍了Aws-Amplify:mark.json和env.json加载index.html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Reaction应用程序My Am构建有一个清单.json和一个env.json,如下所示

但是,当我使用AWS-Amplify将网站发布到S3存储桶时,则会加载我的index.html。在本地主机中一切正常,但在生产环境中,尽管我们可以获得icons和robot.txt等其他文件,但仍存在之前的问题。

我们的公用文件夹的内容是下一个:

asset-manifest.json
browserconfig.xml
ec4c4f981671b5dee24ab5f541f07720.png
ef7c6637c68f269a882e73bcb57a7f6a.woff2
env.json <----- loading index.html
icons
index.html
main-5fbcf0b95e5bf6891f54.js
main-5fbcf0b95e5bf6891f54.js.LICENSE.txt
manifest.json. <----- loading index.html
robots.txt.   <------ working
service-worker.js

Amplify.yml文件如下所示:

 version: 0.1
frontend:
  phases:
    preBuild:
      commands:
        - npm install
    build:
      commands:
        - NODE_ENV=$MY_ENV_SELECTOR node ./node_modules/webpack/bin/webpack.js --mode production --env=prod 
  artifacts:
    baseDirectory: dist
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*

它看起来像是在为我们提供index.html,因为它没有找到所需的文件,但我们不知道为什么会发生这种情况。

我们希望任何人都能帮助我们解决这个问题。

推荐答案

我找到了问题。

基本上,Amplify具有我们需要配置的重定向功能,以便为此文件提供服务。

谢谢大家!

这篇关于Aws-Amplify:mark.json和env.json加载index.html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆