https://firebase.google.com/?hl=ko
ํ๋ก์ ํธ ์์ฑ ํ ์ ์นดํ ๊ณ ๋ฆฌ์์ ๋น๋ > ํธ์คํ ํด๋ฆญ
1. Firebase CLI ์ค์น
$ npm install -g firebase-tools
ํฐ๋ฏธ๋์์ ์คํ
2. ํ๋ก์ ํธ ์ด๊ธฐํ
$ firebase login
$ firebase init
vscode์์ ์คํ (ํฐ๋ฏธ๋์์ ์คํ์ rootํด๋๊น์ง ๊ฐ์ ์คํ)
firebase init (๋ฐ๋์ root ํด๋์์ ์คํ)
๋ฐฉํฅํค๋ก ์ด๋, hosting ์ ํ(space) ํ enter > Use an existing project >
? What do you want to use as your public directory? build
? Configure as a single-page app (rewrite all urls to /index.html)? Yes
...
.firebaserc
firebase.json
์์ฑ ์๋ฃ !
3. Firebase ํธ์คํ ์ ๋ฐฐํฌ
์ฝ์๋ก ์ด๋ > hosting ํ์ด์ง์์ 'firebase ํธ์คํ ์ ์ฌ๋ฌ ์ฌ์ดํธ ์ง์'์ ๋ค๋ฅธ ์ฌ์ดํธ ์ถ๊ฐ
๋ฐฐํฌํ๊ฒ ๋ ์น์ฌ์ดํธ ๋๋ฉ์ธ ์ถ๊ฐ
firebase.json
{
"hosting": {
"site": "emotion-react-proj",
"public": "build",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
"site": "๋๋ฉ์ธ ๋ค์" ์ถ๊ฐ > ๋ค์ ๋น๋
$ firebase deploy
๐ ๋ฐฐํฌ ์๋ฃ !