Files
ttstd-3d-director/vite.config.ts
LKH 3b053c714c init
all

视频

视频

视频

视频

视频

init
2026-07-29 09:17:00 +08:00

28 lines
822 B
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.
import { defineConfig } from "vitest/config";
import react from "@vitejs/plugin-react";
// Windows 上 new URL().pathname 形如 "/D:/...",前导斜杠会让 Vite 解析成 "D:/D:/..."。
// 去掉盘符前的斜杠,避免 dev server 的 fs.allow 把真实路径判为越界(403 Restricted)。
const toFsPath = (url: URL) => decodeURIComponent(url.pathname.replace(/^\/(?=[A-Za-z]:\/)/, ""));
export default defineConfig({
base: "./",
assetsInclude: ["**/*.fbx", "**/*.obj"],
plugins: [react()],
server: {
fs: {
allow: [
toFsPath(new URL(".", import.meta.url)),
toFsPath(new URL("../模型库", import.meta.url)),
],
},
},
test: {
environment: "jsdom",
globals: true,
pool: "threads",
maxWorkers: 1,
setupFiles: "./src/test/setup.ts",
},
});