fix: vite8 preview build react-router in docker failed

This commit is contained in:
ReaJason
2026-08-30 22:01:43 +08:00
parent 961845f96f
commit 13fe8f0094
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -10,6 +10,9 @@ export default defineConfig(({ command, mode }) => {
const contextPath = env.VITE_APP_API_URL?.trim() ?? "";
return {
// React Router 8 prerendering requests the Vite preview server over HTTP.
// Bind it explicitly to IPv4 so `localhost` resolves to the address being listened on in Docker.
preview: { host: "127.0.0.1" },
base: isDev || !contextPath ? "/" : `${contextPath}/`,
plugins: [fumadocsMdx(), tailwindcss(), reactRouter(), devtoolsJson()],
resolve: {