Skip to content

Commit

Permalink
fix(core): use the module name as the name of the nx plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Cammisuli committed Apr 17, 2023
1 parent fab2325 commit 1b75d25
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions packages/nx/src/utils/nx-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 1b75d25

Please sign in to comment.