diff --git a/packages/nx/src/utils/nx-plugin.ts b/packages/nx/src/utils/nx-plugin.ts index 92fa396d596203..d3f8b303e208d1 100644 --- a/packages/nx/src/utils/nx-plugin.ts +++ b/packages/nx/src/utils/nx-plugin.ts @@ -79,13 +79,8 @@ function getPluginPathAndName( throw e; } } - const packageJsonPath = path.join(pluginPath, 'package.json'); - const { name } = - !['.ts', '.js'].some((x) => x === path.extname(pluginPath)) && // Not trying to point to a ts or js file - existsSync(packageJsonPath) // plugin has a package.json - ? readJsonFile(packageJsonPath) // read name from package.json - : { name: path.basename(pluginPath) }; // use the name of the file we point to - return { pluginPath, name }; + + return { pluginPath, name: moduleName }; } export async function loadNxPluginAsync(