mirror of
https://github.com/strapi/strapi.git
synced 2025-10-27 08:02:56 +00:00
Manage email and upload providers from an npm organisation
This commit is contained in:
parent
b0c12a3912
commit
dac168cedb
@ -30,6 +30,20 @@ module.exports = async cb => {
|
||||
return _.startsWith(node_module, 'strapi-provider-email') || _.startsWith(node_module, 'strapi-email');
|
||||
});
|
||||
|
||||
node_modules.filter((node_module) => {
|
||||
return node_module.startsWith('@');
|
||||
})
|
||||
.forEach((orga) => {
|
||||
const node_modules = fs.readdirSync(path.join(basePath, 'node_modules', orga));
|
||||
|
||||
node_modules.forEach((node_module) => {
|
||||
// DEPRECATED strapi-email-* will be remove in next version
|
||||
if (_.startsWith(node_module, 'strapi-provider-email') || _.startsWith(node_module, 'strapi-email')) {
|
||||
emails.push(`${orga}/${node_module}`);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// mount all providers to get configs
|
||||
_.forEach(emails, (node_module) => {
|
||||
strapi.plugins.email.config.providers.push(
|
||||
|
||||
@ -30,6 +30,20 @@ module.exports = async cb => {
|
||||
return _.startsWith(node_module, 'strapi-provider-upload') || _.startsWith(node_module, 'strapi-upload');
|
||||
});
|
||||
|
||||
node_modules.filter((node_module) => {
|
||||
return node_module.startsWith('@');
|
||||
})
|
||||
.forEach((orga) => {
|
||||
const node_modules = fs.readdirSync(path.join(basePath, 'node_modules', orga));
|
||||
|
||||
node_modules.forEach((node_module) => {
|
||||
// DEPRECATED strapi-email-* will be remove in next version
|
||||
if (_.startsWith(node_module, 'strapi-provider-upload') || _.startsWith(node_module, 'strapi-upload')) {
|
||||
uploads.push(`${orga}/${node_module}`);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// mount all providers to get configs
|
||||
_.forEach(uploads, (node_module) => {
|
||||
strapi.plugins.upload.config.providers.push(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user