[backport core/1.33] fix: normalize path separators in comfyAPIPlugin for Windows compatibility (#7089)

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 <terryjia88@gmail.com>
This commit is contained in:
Comfy Org PR Bot
2025-12-02 14:48:49 +09:00
committed by GitHub
parent 792554d6dd
commit 3d7df5762b

View File

@@ -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) {