Skip to content

Commit

Permalink
fix(cli): fix windows path issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Aug 19, 2021
1 parent 251197c commit 57e07f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/bright-zebras-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-mesh/cli': patch
---

fix(cli): fix windows path issue
4 changes: 2 additions & 2 deletions packages/cli/src/commands/ts-artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { pascalCase } from 'pascal-case';
import { Source } from '@graphql-tools/utils';
import * as tsOperationsPlugin from '@graphql-codegen/typescript-operations';
import * as tsGenericSdkPlugin from '@graphql-codegen/typescript-generic-sdk';
import { isAbsolute, relative, join, normalize } from 'path';
import { isAbsolute, relative, join, normalize, sep, win32, posix } from 'path';
import ts from 'typescript';
import { writeFile } from '@graphql-mesh/utils';
import { cwd } from 'process';
Expand Down Expand Up @@ -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}';`);
Expand Down

0 comments on commit 57e07f4

Please sign in to comment.