Firebase hosting + React with webpack

前端 未结 3 1782
迷失自我
迷失自我 2020-12-28 09:09

Is there a way to add Firebase hosting to React project that utilizes webpack? Specifically, I am trying to add it to https://github.com/mxstbr/react-boilerplate

Thi

3条回答
  •  旧时难觅i
    2020-12-28 09:56

    I am using the create-react-app package to create my react app. Invoke the command "npm run build". This generates a "build" directory that includes the webpack output. In your firebase.json file, point to the "build" directory instead. Then run the "firebase serve" or "firebase deploy" command.

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

提交回复
热议问题