diff --git a/build/plugins/comfyAPIPlugin.ts b/build/plugins/comfyAPIPlugin.ts index 3e9a9e5b98..1a3b8d93d5 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) {