[POBTIL] 11일차

SWP·2022년 5월 14일
0

POBTIL

목록 보기
11/21
post-thumbnail

오늘 한 일

  • 15분 독서 _ IT 좀 아는 사람
  • 인프런 타입스크립트 기초강의 완강!!!
  • 과제 수정

깃헙으로 배포하기

  1. 깃헙 레포지토리의 셋팅탭 => pages => 소스를 master로 바꾸고 save

  2. vsc터미널에서 yarn add gh-pages

  3. package.json에 "homepage": "https://깃허브유저네임.github.io/프로젝트네임/" 추가

  4. 스크립트에 predeploy 및 deploy 추가
    "scripts": {
    .
    .
    .
    "predeploy": "yarn build", // build script를 호출하여 build 디렉터리 생성
    "deploy": "gh-pages -d build" // gh-pages를 호출하고 build 디렉터리를 업로드
    }
    4.npm run deploy // yarn 하니 안됐는데 npm하니 됨

  5. Manifest: Line: 1, column: 1, Syntax error 발생.
    index.html의

    저 링크부분 주석처리 해주기

  6. 빈화면

/public/index.html에 아래 코드 추가

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />
  1. index.html 메인파일 말고 다른 페이지에서 새로고침시 404에러
  "scripts": {
    ...
    
    "deploy": "cp build/index.html build/404.html && gh-pages -d build",
    "predeploy": "npm run build"
  },
profile
잘하고싶다...

0개의 댓글