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?

More than 1 year has passed since last update.

Github Pagesで公開したViteのサイトが404になる時

Posted at

Viteの公式サイトにはvite.config.jsのbaseの項目を正しく(基本的にはリポジトリ名と同じに?)設定するように書いてある。

例:

vite.config.js
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

export default defineConfig({
	base: '/リポジトリ名/',
	plugins: [vue()]
})

が、どうやら単に./と設定しても問題なく動きそう。

vite.config.js
// 前略
export default defineConfig({
	base: './',
	plugins: [vue()]
})

リポジトリ名を変えたりVercelに移行したりしてもいちいちいじらなくて済むのでお得。

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?