I have installed Firebase hosting project into my machine by referring following docs:
https://firebase.google.com/docs/hosting/
Now, I want to change the location of my project directory. Wha should I do for this?
Till now I have tried by relogin and re-initialize the project but it does not give option to specify directory again.
Go to the file called firebase. json located in the root of the project and change the field called public in hosting to the directory you want.
A project ID cannot be changed after the project is created, so if you are creating a new project, be sure to choose an ID that you'll be comfortable using for the lifetime of the project. Save this answer.
Go to the file called firebase.json located in the root of the project and change the field called public in hosting to the directory you want.
{
"database": {
"rules": "database.rules.json"
},
"hosting": {
"public": "public", <------ This points to directory
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
EDIT
learn more here
In your npm command go to the directory that the folder is in and type firebase init Easiest way is to open Node.js and type cd "your_directory" without the q
Try these steps
1- create a new directory/folder somewhere on your computer 2- open your command line terminal e.g git/cmd from the created directory by doing the following a) for git: right click on directory and choose git b) for windows cmd: shift + right on created directory and choose cmd 3- type the command firebase init
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