관리 메뉴

CASSIE'S BLOG

github pages 주소 하위주소로 설정하는 거.. 본문

카테고리 없음

github pages 주소 하위주소로 설정하는 거..

ITSCASSIE1107 2024. 1. 22. 21:28
   
    "deploy": "gh-pages -d build",
    "predeploy": "npm run build"

 

1시간이나..날렸어 ㅠㅠㅠ

 

 

⭐npm install gh-pages 먼저 설치

 

⭐ scripts에 위에 명령어 추가

 

⭐ homepage 속성 추가

 

⭐npm run deploy 명령어 실행 

 

{
  "name": "client",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@material-ui/core": "^4.12.3",
    "@material-ui/icons": "^4.11.2",
    "@reduxjs/toolkit": "^1.6.1",
    "@testing-library/jest-dom": "^5.11.4",
    "@testing-library/react": "^11.1.0",
    "@testing-library/user-event": "^12.1.10",
    "axios": "^1.6.2",
    "gh-pages": "^6.1.1",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-error-overlay": "6.0.9",
    "react-redux": "^7.2.5",
    "react-router-dom": "^6.0.0",
    "react-scripts": "4.0.3",
    "react-stripe-checkout": "^2.6.3",
    "redux-persist": "^6.0.0",
    "styled-components": "^5.3.1",
    "web-vitals": "^1.0.1"


  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",

   
    "deploy": "gh-pages -d build",
    "predeploy": "npm run build"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "@babel/plugin-proposal-private-property-in-object": "^7.21.11"
  }
}

 

 

참고는 이거 보고함

 

https://velog.io/@kkyes1210/GitHub-Github-Pages-github.io%EB%A5%BC-%EC%9D%B4%EC%9A%A9%ED%95%B4-React-JS-%EB%B0%B0%ED%8F%AC%ED%95%98%EA%B8%B0

 

왜 안될까..저번에는 했는데 그냥 원상복귀함...

반응형