Next Js application build

那年仲夏 提交于 2020-08-05 10:02:50

问题


I am trying to deploy the next js application in firebase.

For which I have made firebase.json like,

{
  "hosting": {
      "public": ".next",
      "ignore": [
          "firebase.json",
          "**/.*",
          "**/node_modules/**"
      ],
      "rewrites": [
          {
          "source": "**",
          "destination": "/index.html"
          }
      ]
  }
  }

With assumption I have given .next as value for public but when running the app in firebase url, it says that the index.html file is missing like and hence throws page not found error,

If I give dist then it throws error as there is no dist folder available.

So can you help me to exactly point out what happens when we build next js app using npm run build and where does the index.html file comes under which folder?

This will help me to rightly point out the index.html which will run the app successful in firebase.

Please help me and I am stuck with this for long. Big thanks in advance.


回答1:


I would prefer using heroku, there you can go with free account, follow steps in this link, its very easy: https://medium.com/swlh/how-to-host-your-next-js-application-for-free-on-heroku-c6ba99ebb8b8



来源:https://stackoverflow.com/questions/62828039/next-js-application-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!