0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

React→Github pages

Last updated at Posted at 2024-06-30

自分用のメモとして書きます。
気が乗ったらちゃんと詳細付きで書きます。

①npm install gh-pages --save-dev
②package.jsonに以下
"homepage": "https://< your-username >.github.io/< your-repo-name >",
"scripts": {
"predeploy": "npm run build",
"deploy": "gh-pages -d dist"
}
③vite.config.tsにbase: '/< your-repo-name >/'
④npm run build
⑤npm run deploy

${import.meta.env.BASE_URL}images/Hachitan_trim.png
publicフォルダの画像をデプロイ先でも指定したいときはこんな感じに環境変数使う!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?