Skip to content

Commit b663244

Browse files
[backport cloud/1.33] fix: normalize path separators in comfyAPIPlugin for Windows compatibility (#7090)
Backport of #7087 to `cloud/1.33` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7090-backport-cloud-1-33-fix-normalize-path-separators-in-comfyAPIPlugin-for-Windows-compat-2bd6d73d365081228497fa23b58b8978) by [Unito](https://www.unito.io) Co-authored-by: Terry Jia <[email protected]>
1 parent c8a1df3 commit b663244

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)