【问题标题】:preact-cli and firebase static deploymentpreact-cli 和 firebase 静态部署
【发布时间】:2017-10-14 07:20:01
【问题描述】:

我已经通过 preact-cli 生成了 Progressive Web App,并希望在 firebase static 上进行部署

npm run serve -- --server config

上面的命令给了我静态输出。但不会将网站推送到 Firebase 托管。

【问题讨论】:

    标签: firebase-hosting preact


    【解决方案1】:

    你需要在项目中有firebase.json 文件,在构建文件中有database.rules.json 文件。一旦你有了这些文件,试试firebase init 然后选择数据库然后试试firebase deploy

    database.rules.json

        {
      "rules": {
        ".read": "auth != null",
        ".write": "auth != null"
      }
    }
    

    firebase.json

    {
      "database": {
        "rules": "build/database.rules.json"
      },
      "hosting": {
        "public": "build",
        "rewrites": [
          {
            "source": "**",
            "destination": "/build/index.html"
          }
        ]
      }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-12-23
      • 1970-01-01
      • 2010-11-03
      • 2021-03-24
      • 2017-12-01
      • 1970-01-01
      相关资源
      最近更新 更多