mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-21 22:50:42 +08:00
fix: vite8 preview build react-router in docker failed
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import { ExternalLinkIcon } from "lucide-react";
|
|
||||||
import type { LinkItemType } from "fumadocs-ui/layouts/shared";
|
import type { LinkItemType } from "fumadocs-ui/layouts/shared";
|
||||||
|
|
||||||
|
import { ExternalLinkIcon } from "lucide-react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
import { LanguageSwitcher } from "@/components/language-switcher";
|
import { LanguageSwitcher } from "@/components/language-switcher";
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ export default defineConfig(({ command, mode }) => {
|
|||||||
const contextPath = env.VITE_APP_API_URL?.trim() ?? "";
|
const contextPath = env.VITE_APP_API_URL?.trim() ?? "";
|
||||||
|
|
||||||
return {
|
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}/`,
|
base: isDev || !contextPath ? "/" : `${contextPath}/`,
|
||||||
plugins: [fumadocsMdx(), tailwindcss(), reactRouter(), devtoolsJson()],
|
plugins: [fumadocsMdx(), tailwindcss(), reactRouter(), devtoolsJson()],
|
||||||
resolve: {
|
resolve: {
|
||||||
|
|||||||
Reference in New Issue
Block a user