TanStack Router のプロジェクトを Firebase Hosting にサクッと公開する
TanStack Router のアプリを Firebase Hosting にサクッとデプロイ
プロジェクトの作成
$ npx @tanstack/cli create --router-only
$ cd sandbox-tanstack-router-firebase-hostirng
Firebase CLI のログイン
code:sh
npm i -g firebase-tools
firebase login
プロジェクト作成、Hosting 初期化
$ firebase init hosting
GCP プロジェクトは、プロンプトの質問の中で作成した
Use an existing project? → 既存 or 新規作成
What do you want to use as your public directory? → dist
tamago324.icon dist にする
Configure as a single-page app (rewrite all urls to /index.html)? → Yes
TanStack Router はクライアント側ルーティングなので必須
Set up automatic builds and deploys with GitHub? → 今すぐ要らなければ No
File dist/index.html already exists. Overwrite? → 基本 No(初回は状況次第)
ビルドしてデプロイ
$ pnpm run build
$ firebase deploy
https://gyazo.com/c480562a6b72843829f7b6440f0be89e