๐Ÿ–ฅ๏ธHow to publish?

Kyeongeun Joยท2022๋…„ 4์›” 5์ผ
0
post-thumbnail

๋ฆฌ์•กํŠธ์˜ ๋ฐฐํฌ ๊ณผ์ •์œผ๋กœ github page๋ฅผ ์ด์šฉํ•  ๊ฒฝ์šฐ์˜ ์˜ˆ์‹œ.

1. commands -> gh-pages install

npm i gh-pages

2. homepage ์ถ”๊ฐ€ (package.json)

"homepage" : "https://(github์•„์ด๋””).github.io/(repository์ด๋ฆ„)"

3. deploy ๊ด€๋ จ ์ฝ”๋“œ ์ถ”๊ฐ€ (package.json)

  1. npm run build : build
  2. npm run deploy : build with page
"scripts": {
  "start": "react-scripts start",
  "build": "react-scripts build",
  "eject": "react-scripts eject",
  "predeploy": "npm run build",
  "deploy": "gh-pages -d build"
},

์ตœ์ข…์ ์œผ๋กœ npm run deploy๋ฅผ ์‹คํ–‰ํ•  ๊ฒฝ์šฐ์—” page๊นŒ์ง€ ๊ฐ™์ด ์—…๋กœ๋“œ ๋˜๋Š”๊ฑธ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

0๊ฐœ์˜ ๋Œ“๊ธ€