fix(core): use the module name as the name of the nx plugin (#16335)
This commit is contained in:
parent
abf534c265
commit
fa40367f2f
@ -80,11 +80,12 @@ function getPluginPathAndName(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const packageJsonPath = path.join(pluginPath, 'package.json');
|
const packageJsonPath = path.join(pluginPath, 'package.json');
|
||||||
|
|
||||||
const { name } =
|
const { name } =
|
||||||
!['.ts', '.js'].some((x) => x === path.extname(pluginPath)) && // Not trying to point to a ts or js file
|
!['.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
|
existsSync(packageJsonPath) // plugin has a package.json
|
||||||
? readJsonFile(packageJsonPath) // read name from package.json
|
? readJsonFile(packageJsonPath) // read name from package.json
|
||||||
: { name: path.basename(pluginPath) }; // use the name of the file we point to
|
: { name: moduleName };
|
||||||
return { pluginPath, name };
|
return { pluginPath, name };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user