📓 TIL

[220714] vercel 로 배포하기

k_m_jin 2022. 7. 14. 21:56
npm i -D vercel

루트경로에

vercel.json 생성

 

package.json

"scripts": {
"vercel": "vercel dev"
},

 

npm run vercel

> notion-test@0.0.0 vercel
> vercel dev

Vercel CLI 27.1.2
> > No existing credentials found. Please log in:
> Log in to Vercel github
> Success! GitHub authentication complete for mel917@naver.com
? Set up and develop “~/study/TIL/vue/vercel-notion_vite-vue3-ts”? [Y/n] y
? Which scope should contain your project? k-m-jin
? Link to existing project? [y/N] n
? What’s your project’s name? vercel-notion-vite-vue3-ts
? In which directory is your code located? ./
Local settings detected in vercel.json:
Auto-detected Project Settings (Vite):
- Build Command: vite build
- Development Command: vite --port $PORT
- Install Command: `yarn install`, `pnpm install`, or `npm install`
- Output Directory: dist
? Want to modify these settings? [y/N] n
🔗  Linked to k-m-jin/vercel-notion-vite-vue3-ts (created .vercel)
> Running Dev Command “vite --port $PORT”

  vite v2.9.12 dev server running at:

  > Local: http://localhost:3000/
  > Network: use `--host` to expose

proxy : 가로채기

 여러개의 스크립트를 동시에 실행할 수 있는 라이브러리

npm i -D concurrently

dev 를 돌리면 watch- 의 모든 스크립트가 실행됌

"scripts": {
    "dev": "concurrently npm:watch-*",
    "watch-dev": "vite",
    "watch-vercel": "vercel dev --listen 2999",
    }

vercel 에 환경변수 추가 / 리전 변경


edge function

: 사용자와 가까운 리전으로 자동으로 리전 변경


Node.Js

: javascript 를 가지고 컴퓨터를 제어하는 환경(런타임)

 

fs.mkdir(path[, options], callback)

fs.writeSync(fd, string[, position[, encoding]])

 

 

출처 패스트캠퍼스 박영웅 강사님

반응형