fix(test): avoid Vite runtime import in UI config helpers · openclaw/openclaw@fcc279e
vincentkoc
·
2026-06-01
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3,7 +3,7 @@ import fs from "node:fs";
|
3 | 3 | import { createRequire } from "node:module"; |
4 | 4 | import path from "node:path"; |
5 | 5 | import { fileURLToPath } from "node:url"; |
6 | | -import { defineConfig, type Plugin } from "vite"; |
| 6 | +import type { Plugin, UserConfig } from "vite"; |
7 | 7 | import { controlUiManualChunk } from "./config/control-ui-chunking.ts"; |
8 | 8 | |
9 | 9 | const here = path.dirname(fileURLToPath(import.meta.url)); |
@@ -220,7 +220,7 @@ function controlUiServiceWorkerBuildIdPlugin(buildId: string): Plugin {
|
220 | 220 | }; |
221 | 221 | } |
222 | 222 | |
223 | | -export default defineConfig(() => { |
| 223 | +export default function controlUiViteConfig(): UserConfig { |
224 | 224 | const envBase = process.env.OPENCLAW_CONTROL_UI_BASE_PATH?.trim(); |
225 | 225 | const base = envBase ? normalizeBase(envBase) : "./"; |
226 | 226 | const controlUiBuildId = resolveControlUiBuildId(); |
@@ -282,4 +282,4 @@ export default defineConfig(() => {
|
282 | 282 | }, |
283 | 283 | ], |
284 | 284 | }; |
285 | | -}); |
| 285 | +} |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。