From 3d7df5762b8ae7f5fa4d3ff18769b49963cde12a Mon Sep 17 00:00:00 2001 From: Comfy Org PR Bot Date: Tue, 2 Dec 2025 14:48:49 +0900 Subject: [PATCH] [backport core/1.33] fix: normalize path separators in comfyAPIPlugin for Windows compatibility (#7089) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport of #7087 to `core/1.33` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7089-backport-core-1-33-fix-normalize-path-separators-in-comfyAPIPlugin-for-Windows-compati-2bd6d73d3650817e83d5d2cc101dc9a1) by [Unito](https://www.unito.io) Co-authored-by: Terry Jia --- 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 3e9a9e5b9..1a3b8d93d 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) {