From 75c34c3d8d30441a6ede905ed84843598a27280b Mon Sep 17 00:00:00 2001 From: Craigory Coppola Date: Tue, 13 Dec 2022 17:05:30 -0500 Subject: [PATCH] fix(core): local plugins should work on windows (#13801) --- packages/nx/src/utils/nx-plugin.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/nx/src/utils/nx-plugin.ts b/packages/nx/src/utils/nx-plugin.ts index 0b706a6f7f499..153e752f49782 100644 --- a/packages/nx/src/utils/nx-plugin.ts +++ b/packages/nx/src/utils/nx-plugin.ts @@ -21,6 +21,7 @@ import { createProjectRootMappingsFromProjectConfigurations, findProjectForPath, } from '../project-graph/utils/find-project-for-path'; +import { normalizePath } from './path'; export type ProjectTargetConfigurator = ( file: string @@ -195,7 +196,7 @@ function findNxProjectForImportPath( ): string | null { const tsConfigPaths: Record = readTsConfigPaths(root); const possiblePaths = tsConfigPaths[importPath]?.map((p) => - path.relative(root, path.join(root, p)) + normalizePath(path.relative(root, path.join(root, p))) ); if (possiblePaths?.length) { const projectRootMappings =