Files
UserhomeFront/harness.vite.config.ts
T
chenxing 19e1bbc9d7
build / build (push) Successful in 1m8s
设置界面更新
2026-10-08 10:08:22 +08:00

47 lines
1.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* 视觉取证专用临时配置(步骤 4 审计;不进 git)。
* 坑:主配置的 createHtmlPlugin 会把根目录任意 html 的入口 script 重写为 /src/main.ts,
* 第二入口会静默加载主应用 —— 故此处独立配置,只挂 vue + svg-icons,不碰主配置。
* 构建 harness.html 单入口(静态产物走 vite preview —— dev 的 HMR websocket 会冻结
* 无头 Edge 的 virtual clock,所有 setTimeout 停摆,断言器与截图都无法完成)。
* 主题通道走 YschTheme serve:static(9527,已开 CORS,iframe 直连无需代理)。
*/
import vue from "@vitejs/plugin-vue";
import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
import path, { resolve } from "path";
export default {
plugins: [
vue(),
createSvgIconsPlugin({
iconDirs: [resolve(process.cwd(), "src/assets/icons")],
symbolId: "icon-[dir]-[name]",
inject: "body-last",
customDomId: "__svg__icons__dom__",
}),
],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
server: {
host: "localhost",
port: 8131,
},
preview: {
host: "localhost",
port: 8132,
},
base: "./",
build: {
outDir: "dist_harness",
emptyOutDir: true,
rollupOptions: {
input: {
harness: resolve(__dirname, "harness.html"),
},
},
},
} as any;