fix: 修正 vite 构建的 Windows 路径解析

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
1111
2026-04-19 18:50:20 +08:00
parent dbc8a85cd7
commit 7a9f53b63f

View File

@@ -1,11 +1,12 @@
import { defineConfig, type Plugin } from "vite";
import { resolve, dirname } from "path";
import { fileURLToPath } from "url";
import { readFileSync } from "fs";
import { getMacroDefines } from "./scripts/defines";
import featureFlagsPlugin from "./scripts/vite-plugin-feature-flags";
import importMetaRequirePlugin from "./scripts/vite-plugin-import-meta-require";
const projectRoot = dirname(new URL(import.meta.url).pathname);
const projectRoot = dirname(fileURLToPath(import.meta.url));
/**
* Plugin to import .md files as raw strings (Bun's text loader behavior).