mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-26 00:41:52 +08:00
build: assets link error
This commit is contained in:
+1
-1
@@ -8,7 +8,7 @@ RUN git clone --depth 1 https://github.com/ReaJason/MemShellParty.git . && \
|
|||||||
# https://hub.docker.com/r/oven/bun
|
# https://hub.docker.com/r/oven/bun
|
||||||
FROM --platform=$BUILDPLATFORM oven/bun:1.3.11 AS frontend
|
FROM --platform=$BUILDPLATFORM oven/bun:1.3.11 AS frontend
|
||||||
|
|
||||||
ARG ROUTE_ROOT_PATH="/"
|
ARG ROUTE_ROOT_PATH=""
|
||||||
ARG CONTEXT_PATH=""
|
ARG CONTEXT_PATH=""
|
||||||
|
|
||||||
WORKDIR /usr/src/web
|
WORKDIR /usr/src/web
|
||||||
|
|||||||
+9
-5
@@ -2,15 +2,18 @@ import { reactRouter } from "@react-router/dev/vite";
|
|||||||
import tailwindcss from "@tailwindcss/vite";
|
import tailwindcss from "@tailwindcss/vite";
|
||||||
import mdx from "fumadocs-mdx/vite";
|
import mdx from "fumadocs-mdx/vite";
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
import { env } from "node:process";
|
import { defineConfig, loadEnv } from "vite";
|
||||||
import { defineConfig } from "vite";
|
|
||||||
import devtoolsJson from "vite-plugin-devtools-json";
|
import devtoolsJson from "vite-plugin-devtools-json";
|
||||||
|
|
||||||
import * as MdxConfig from "./source.config";
|
import * as MdxConfig from "./source.config";
|
||||||
|
|
||||||
const isDev = env.NODE_ENV === "development";
|
export default defineConfig(({ command, mode }) => {
|
||||||
export default defineConfig({
|
const env = loadEnv(mode, process.cwd(), "VITE_APP_");
|
||||||
base: isDev ? "/" : `${env.VITE_APP_API_URL}/`,
|
const isDev = command === "serve";
|
||||||
|
const contextPath = env.VITE_APP_API_URL?.trim() ?? "";
|
||||||
|
|
||||||
|
return {
|
||||||
|
base: isDev || !contextPath ? "/" : `${contextPath}/`,
|
||||||
plugins: [mdx(MdxConfig), tailwindcss(), reactRouter(), devtoolsJson()],
|
plugins: [mdx(MdxConfig), tailwindcss(), reactRouter(), devtoolsJson()],
|
||||||
resolve: {
|
resolve: {
|
||||||
tsconfigPaths: true,
|
tsconfigPaths: true,
|
||||||
@@ -23,4 +26,5 @@ export default defineConfig({
|
|||||||
: {}),
|
: {}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user