mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
fix(test): avoid Vite runtime import in UI config helpers
This commit is contained in:
@@ -3,7 +3,7 @@ import fs from "node:fs";
|
||||
import { createRequire } from "node:module";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { defineConfig, type Plugin } from "vite";
|
||||
import type { Plugin, UserConfig } from "vite";
|
||||
import { controlUiManualChunk } from "./config/control-ui-chunking.ts";
|
||||
|
||||
const here = path.dirname(fileURLToPath(import.meta.url));
|
||||
@@ -220,7 +220,7 @@ function controlUiServiceWorkerBuildIdPlugin(buildId: string): Plugin {
|
||||
};
|
||||
}
|
||||
|
||||
export default defineConfig(() => {
|
||||
export default function controlUiViteConfig(): UserConfig {
|
||||
const envBase = process.env.OPENCLAW_CONTROL_UI_BASE_PATH?.trim();
|
||||
const base = envBase ? normalizeBase(envBase) : "./";
|
||||
const controlUiBuildId = resolveControlUiBuildId();
|
||||
@@ -282,4 +282,4 @@ export default defineConfig(() => {
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user