From 5a7ed3e93c447481033a00af13aaf7b25fa37160 Mon Sep 17 00:00:00 2001 From: Terry Jia Date: Mon, 1 Dec 2025 20:55:14 -0500 Subject: [PATCH] fix: normalize path separators in comfyAPIPlugin for Windows compatibility --- build/plugins/comfyAPIPlugin.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build/plugins/comfyAPIPlugin.ts b/build/plugins/comfyAPIPlugin.ts index 3e9a9e5b987..1a3b8d93d58 100644 --- a/build/plugins/comfyAPIPlugin.ts +++ b/build/plugins/comfyAPIPlugin.ts @@ -88,12 +88,14 @@ export function comfyAPIPlugin(isDev: boolean): Plugin { if (result.exports.length > 0) { const projectRoot = process.cwd() - const relativePath = path.relative(path.join(projectRoot, 'src'), id) + const relativePath = path + .relative(path.join(projectRoot, 'src'), id) + .replace(/\\/g, '/') const shimFileName = relativePath.replace(/\.ts$/, '.js') let shimContent = `// Shim for ${relativePath}\n` - const fileKey = relativePath.replace(/\.ts$/, '').replace(/\\/g, '/') + const fileKey = relativePath.replace(/\.ts$/, '') const warningMessage = getWarningMessage(fileKey, shimFileName) if (warningMessage) {