chore(dev): update vite configuration (#16110)

This commit is contained in:
anatawa12 2025-05-27 15:18:37 +09:00 committed by GitHub
parent e078cd9296
commit e954060f3b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 2 deletions

View File

@ -66,9 +66,15 @@ export function getConfig(): UserConfig {
return {
base: '/embed_vite/',
// The console is shared with backend, so clearing the console will also clear the backend log.
clearScreen: false,
server: {
host,
// The backend allows access from any addresses, so vite also allows access from any addresses.
host: '0.0.0.0',
allowedHosts: host ? [host] : undefined,
port: 5174,
strictPort: true,
hmr: {
// バックエンド経由での起動時、Viteは5174経由でアセットを参照していると思い込んでいるが実際は3000から配信される
// そのため、バックエンドのWSサーバーにHMRのWSリクエストが吸収されてしまい、正しくHMRが機能しない

View File

@ -81,9 +81,15 @@ export function getConfig(): UserConfig {
return {
base: '/vite/',
// The console is shared with backend, so clearing the console will also clear the backend log.
clearScreen: false,
server: {
host,
// The backend allows access from any addresses, so vite also allows access from any addresses.
host: '0.0.0.0',
allowedHosts: host ? [host] : undefined,
port: 5173,
strictPort: true,
hmr: {
// バックエンド経由での起動時、Viteは5173経由でアセットを参照していると思い込んでいるが実際は3000から配信される
// そのため、バックエンドのWSサーバーにHMRのWSリクエストが吸収されてしまい、正しくHMRが機能しない