diff --git a/packages/workspace/src/utils/runtime-lint-utils.ts b/packages/workspace/src/utils/runtime-lint-utils.ts index a1620a14446a8..d2f90e9644e36 100644 --- a/packages/workspace/src/utils/runtime-lint-utils.ts +++ b/packages/workspace/src/utils/runtime-lint-utils.ts @@ -10,7 +10,7 @@ import { joinPathFragments, FileData, } from '@nrwl/devkit'; -import { join } from 'path'; +import { join, relative } from 'path'; import { workspaceRoot } from './app-root'; import { getPath, pathExists } from './graph-utils'; import { existsSync } from 'fs'; @@ -207,7 +207,7 @@ export function onlyLoadChildren( } export function getSourceFilePath(sourceFileName: string, projectPath: string) { - return normalizePath(sourceFileName).substring(projectPath.length + 1); + return normalizePath(relative(projectPath, sourceFileName)); } export function hasBannedImport(