From 01bfd65de75ec4469680fa1146266b3b42f1bf52 Mon Sep 17 00:00:00 2001 From: Arda TANRIKULU Date: Thu, 19 Aug 2021 17:42:18 +0300 Subject: [PATCH] fix(cli): fix windows path issue --- .changeset/bright-zebras-do.md | 5 +++++ packages/cli/src/commands/ts-artifacts.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/bright-zebras-do.md diff --git a/.changeset/bright-zebras-do.md b/.changeset/bright-zebras-do.md new file mode 100644 index 0000000000000..d4ae20665ace3 --- /dev/null +++ b/.changeset/bright-zebras-do.md @@ -0,0 +1,5 @@ +--- +'@graphql-mesh/cli': patch +--- + +fix(cli): fix windows path issue diff --git a/packages/cli/src/commands/ts-artifacts.ts b/packages/cli/src/commands/ts-artifacts.ts index 3ef041f178889..54be4a70ccdc7 100644 --- a/packages/cli/src/commands/ts-artifacts.ts +++ b/packages/cli/src/commands/ts-artifacts.ts @@ -196,7 +196,7 @@ export async function generateTsArtifacts({ } if (isAbsolute(importPath)) { moduleMapProp = relative(baseDir, importedModuleName); - importPath = `./${relative(artifactsDir, importedModuleName)}`; + importPath = `./${relative(artifactsDir, importedModuleName).split('\\').join('/')}`; } const importedModuleVariable = pascalCase(`ExternalModule$${i}`); importCodes.push(`import ${importedModuleVariable} from '${importPath}';`);