Merge pull request #20879 from strapi/fix/issue-20298

fix: resolve internal plugins from the strapi pkg
This commit is contained in:
Alexandre BODIN 2024-07-30 10:01:55 +02:00 committed by GitHub
commit 1f44a7b49a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -90,7 +90,13 @@ export const getEnabledPlugins = async (strapi: Core.Strapi, { client } = { clie
for (const dep of INTERNAL_PLUGINS) {
const packagePath = join(dep, 'package.json');
const packageInfo = require(packagePath);
// NOTE: internal plugins should be resolved from the strapi package
const packageModulePath = require.resolve(packagePath, {
paths: [require.resolve('@strapi/strapi/package.json'), process.cwd()],
});
const packageInfo = require(packageModulePath);
validatePluginName(packageInfo.strapi.name);
internalPlugins[packageInfo.strapi.name] = {