Reputation: 629
I used firebase hosting to serve my react website. If I want to make changes to my website, do I need to type npm run build
every time after I change my local files so that a new build folder overlaps the old one and then type firebase deploy
?
Upvotes: 3
Views: 6030
Reputation: 1
It will work in 3 steps:
npm run build
firebase deploy
Run the above commands and then refresh the page.
Upvotes: 0
Reputation: 11
Do all your the changes in your React app. And run
1st Command- npm run deploy
2nd Command- firebase deploy
It's done.
Upvotes: 1
Reputation: 99
You just have to run two commands.
npm run build
firebase deploy
that's it. Then refresh your web page.Upvotes: 4
Reputation: 459
You don't need to deploy firebase to cloud hosting every time you want to test it locally.
You can use firebase serve --only hosting
to deploy on localhost.
npm run build
depends entirely on your package.json, I'm not sure what your scripts look like.
However, I think your actually asking how to achieve hot reloading of your client during development. I don't remember ever having an issue achieving this using Create-React-App https://reactjs.org/docs/create-a-new-react-app.html#create-react-app which uses webpack.
The user guide details how to use npm start
which should enforce hot-reloading: https://create-react-app.dev/docs/available-scripts#npm-start
Upvotes: 0
Reputation: 317497
Yes, that is required. If you don't generate and deploy new code and assets, nothing will change on your site.
Upvotes: 0