Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/vite-plugin-webmcp/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ export function vitePluginWebMcp(options: WebMcpPluginOptions = {}): Plugin {
if (!/\.[jt]sx?$/.test(cleanId)) return null;

// include 匹配检查
const relativePath = nodePath.relative(projectRoot, cleanId);
// 统一使用正斜杠,避免 Windows 反斜杠导致 glob 匹配失败
const relativePath = nodePath.relative(projectRoot, cleanId).replace(/\\/g, '/');
const isIncluded = include.some(pattern => {
const regex = new RegExp(
'^' +
Expand Down