Its quite simple,the only thing you need to do is go to your hosted site. right click and go to inspect element => debugger. There you will find a static folder. relax,all your js files are there(front end only),you can copy your code.
Using the Firebase CLI, you deploy files from local directories on your computer to our Hosting servers. Beyond serving static content, you can use Cloud Functions for Firebase or Cloud Run to serve dynamic content and host microservices on your sites.
Go to the Firebase console and select your project. From the project overview page, under the text Get started by adding Firebase to your app, select web. If you already have an app added to the project, you may not see this text; instead, navigate to the settings page of your existing app or select add app.
The step to deploy are as following
STEP 1:
ng build --prod
STEP 2:
firebase init
*Are you ready to proceed?* Yes
*What do you want to use as your public directory?* dist/{your-application-name}
*Configure as a single-page app (rewrite all urls to /index.html)?(y/N)* Yes
*File dist/{your-application-name}/index.html already exists. Overwrite?(y/N)* No
STEP 3:
firebase deploy --only hosting
And if still you are getting the same page just press 'CTRL + F5' it will clean the cached.
It's because the index.html
has modified itself when you selected "Y"
while initializing the firebase. It has basically replaced your own index file to this one. Check and replace the index file and next time, do not overwrite index.html file. It would work.
I faced the same problem. In my case the issue was not with firebase. Just clearing the cache was the solution.
Firebase hosting not showing up app?
There might be two reasons for this problem
1st step:
Make sure your public folder (define in your firebase.json) 'dist' containing the index.html hasn't been modified by firebase init command, if yes replace it with your original project index.html
for reference (dist is standard but your may different)
{
"hosting": {
"public": "dist"
}
}
2nd step:
Make sure to configure your base href in project's index.html
as
< base href="https://["YOUR FIREBASE PROJECT NAME"].firebaseapp.com/">
and other bundle files as
< script type="text/javascript" src="https://["YOUR FIREBASE PROJECT NAME"].firebaseapp.com/runtime.a66f828dca56eeb90e02.js"></script>
< script type="text/javascript" src="https://["YOUR FIREBASE PROJECT NAME"].firebaseapp.com/polyfills.14fc14f3e029a8cfd046.js"></script>
< script type="text/javascript" src="https://["YOUR FIREBASE PROJECT NAME"].firebaseapp.com/main.2eb2046276073df361f7.js"></script>
3rd step
run the command firebase deploy
enjoy ! ;)
I had ran to this issue and
If anybody had encounters the same after using firebase init command,
check your index.html file in your public folder (for react).
it might have been overridden by firebase.
in order to tell firebase not to override your existing index.html file,
type 'N' when firebase asks if you want to override the existing index.html file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With