mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-21 22:50:42 +08:00
build: assets link error
This commit is contained in:
+1
-1
@@ -1,2 +1,2 @@
|
||||
VITE_APP_API_URL=
|
||||
VITE_APP_BASE_PATH=/ui
|
||||
VITE_APP_BASE_PATH=/ui
|
||||
|
||||
+20
-16
@@ -2,25 +2,29 @@ import { reactRouter } from "@react-router/dev/vite";
|
||||
import tailwindcss from "@tailwindcss/vite";
|
||||
import mdx from "fumadocs-mdx/vite";
|
||||
import path from "node:path";
|
||||
import { env } from "node:process";
|
||||
import { defineConfig } from "vite";
|
||||
import { defineConfig, loadEnv } from "vite";
|
||||
import devtoolsJson from "vite-plugin-devtools-json";
|
||||
|
||||
import * as MdxConfig from "./source.config";
|
||||
|
||||
const isDev = env.NODE_ENV === "development";
|
||||
export default defineConfig({
|
||||
base: isDev ? "/" : `${env.VITE_APP_API_URL}/`,
|
||||
plugins: [mdx(MdxConfig), tailwindcss(), reactRouter(), devtoolsJson()],
|
||||
resolve: {
|
||||
tsconfigPaths: true,
|
||||
alias: {
|
||||
"@": path.resolve(__dirname, "./app"),
|
||||
...(!isDev
|
||||
? {
|
||||
"react-dom/server": "react-dom/server.node",
|
||||
}
|
||||
: {}),
|
||||
export default defineConfig(({ command, mode }) => {
|
||||
const env = loadEnv(mode, process.cwd(), "VITE_APP_");
|
||||
const isDev = command === "serve";
|
||||
const contextPath = env.VITE_APP_API_URL?.trim() ?? "";
|
||||
|
||||
return {
|
||||
base: isDev || !contextPath ? "/" : `${contextPath}/`,
|
||||
plugins: [mdx(MdxConfig), tailwindcss(), reactRouter(), devtoolsJson()],
|
||||
resolve: {
|
||||
tsconfigPaths: true,
|
||||
alias: {
|
||||
"@": path.resolve(__dirname, "./app"),
|
||||
...(!isDev
|
||||
? {
|
||||
"react-dom/server": "react-dom/server.node",
|
||||
}
|
||||
: {}),
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user