首页 > 解决方案 > 即使服务工作者没有缓存更改,Firebase 托管也不会选择 CRA 最新部署

问题描述

我使用托管在 firebase 托管上的 create react 应用程序。即使在文档https://facebook.github.io/create-react-app/docs/deployment#firebase-https-firebasegooglecom中指出了更改,也不会选择最新的更改。

我的 firebase.json 配置文件。

{
  "hosting": {
    "public": "build",
    "ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
    "headers": [{ "source": "/service-worker.js", "headers": [{ "key": "Cache-Control", "value": "no-cache" }] }],
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ]
  }
}

任何帮助请

标签: reactjsfirebasecreate-react-app

解决方案


推荐阅读