USBポートサイズマイコン「Tomu」の開発環境構築
Getting started with Tomu
Technical knowledge base by pigmal, LLC
last update: 2018-09-10 00:00:00 +0000
firebase CLIでプロジェクトおよび公開するファイルのディレクトリなどを指定する
$ firebase init
Hosting
カーソルを合わせてスペースでチェックしてEnterpublic
Configure as a single-page app (rewrite all urls to /index.html)?
.firebaserc
firebase.json
$ firebase serve
$ firebase deploy --only hosting
add another site
<site-name>.firebaseapp.com
というURLのサイトを取得する
$ firebase target:apply hosting <target> <site-name>
// for default hosting
$ firebase target:apply hosting <defalut-site> <project-name>
target:apply で指定した内容は、.firebasercに記述されている。上記を実行すると以下のようになる
{
"projects": {
"default": "<project-name>"
},
"targets": {
"<project-name>": {
"hosting": {
"<target>": [
"<site-name>"
],
"<default-site>": [
"<project-name>"
]
}
}
}
}
(※2018/9/16現在)CLIで設定は出来ず、マルチサイト対応するにはfirebase.json
を手書きで修正する必要がある。
{
"hosting": [{
"target": "<target>",
"public": "<path-to-files-for-target>",
},
{
"target": "<default-site>",
"public": "<path-to-files-for-default>",
}]
}
$ firebase deploy --only hosting:<target>
Connect domain