4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

firebase.jsonのsource .は何を表しているのか

Posted at

はじめに

firebase.jsonの設定がよくわからずに利用していて、なぜかうまいっている状態だったので調べてみたのでまとめていきます

問題

$ firebase init hosting

ここで以下のような選択でYesを選択すると自動でsource: .が設定されます

=== Hosting Setup
? Do you want to use a web framework? (experimental) (y/N) 
firebase.json
{
  "hosting": {
    "source": ".",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "frameworksBackend": {
      "region": "asia-east1"
    }
  }
}

ここで、他の方は以下のようにやっています

firebase.json
{
  "hosting": {
    "public": "out",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ]
  }
}

ここでの違いは何かあるのでしょうか?またなぜsource: .でうまくデプロイがされるのか謎だったので調べました

解決方法

先程の質問でyesとすることfirebase-webframework-toolsを利用することが可能です

これを利用すると、source: .とすることでReactやNext.jsなどのプロジェクトを認識していい感じにデプロイすることが可能になっていました

意識しなくても設定できるのはとてもよいですね

おわりに

長年の疑問が晴れてよかったです。よりfirebaseを使いやすくなりました

4
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?