Skip to content

Commit 3d7df57

Browse files
[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>
1 parent 792554d commit 3d7df57

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

build/plugins/comfyAPIPlugin.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,14 @@ export function comfyAPIPlugin(isDev: boolean): Plugin {
8888

8989
if (result.exports.length > 0) {
9090
const projectRoot = process.cwd()
91-
const relativePath = path.relative(path.join(projectRoot, 'src'), id)
91+
const relativePath = path
92+
.relative(path.join(projectRoot, 'src'), id)
93+
.replace(/\\/g, '/')
9294
const shimFileName = relativePath.replace(/\.ts$/, '.js')
9395

9496
let shimContent = `// Shim for ${relativePath}\n`
9597

96-
const fileKey = relativePath.replace(/\.ts$/, '').replace(/\\/g, '/')
98+
const fileKey = relativePath.replace(/\.ts$/, '')
9799
const warningMessage = getWarningMessage(fileKey, shimFileName)
98100

99101
if (warningMessage) {

0 commit comments

Comments
 (0)