Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change Firebase project directory

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.

like image 489
Faisal Shaikh Avatar asked Nov 11 '16 20:11

Faisal Shaikh


People also ask

How to change directory Firebase?

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.

Can I change Firebase project name?

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.


3 Answers

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

like image 88
Moddaman Avatar answered Oct 23 '22 15:10

Moddaman


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

like image 40
Mike Stratmann Avatar answered Oct 23 '22 16:10

Mike Stratmann


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

like image 41
Jobie J Avatar answered Oct 23 '22 17:10

Jobie J