Skip to content

Commit fab05e8

Browse files
committed
chore(frontend): configure vite hmr host
1 parent b1a1cb0 commit fab05e8

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

frontend/vite.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import path from 'path'
66
export default defineConfig(({ mode }) => {
77
const env = loadEnv(mode, process.cwd(), '')
88
const apiProxyTarget = env.VITE_API_PROXY_TARGET || 'http://localhost:8000'
9+
const hmrHost = env.VITE_HMR_HOST || '127.0.0.1'
10+
const hmrPort = Number(env.VITE_HMR_PORT || 3000)
911

1012
return {
1113
plugins: [react()],
@@ -19,6 +21,11 @@ export default defineConfig(({ mode }) => {
1921
},
2022
server: {
2123
port: 3000,
24+
hmr: {
25+
host: hmrHost,
26+
clientPort: hmrPort,
27+
protocol: 'ws',
28+
},
2229
proxy: {
2330
'/api': {
2431
target: apiProxyTarget,

0 commit comments

Comments
 (0)