From 1b75d2564a523975e992284510f8525a495faaff Mon Sep 17 00:00:00 2001 From: Jonathan Cammisuli Date: Mon, 17 Apr 2023 07:15:24 -0400 Subject: [PATCH] fix(core): use the module name as the name of the nx plugin --- packages/nx/src/utils/nx-plugin.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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(