mirror of
https://github.com/strapi/strapi.git
synced 2025-09-23 15:29:27 +00:00
apply feedback
Signed-off-by: harimkims <harimkims@gmail.com>
This commit is contained in:
parent
de3ee7e98a
commit
b56bd71be9
@ -3,6 +3,7 @@
|
|||||||
const { join } = require('path');
|
const { join } = require('path');
|
||||||
const fse = require('fs-extra');
|
const fse = require('fs-extra');
|
||||||
const { defaultsDeep, getOr, get } = require('lodash/fp');
|
const { defaultsDeep, getOr, get } = require('lodash/fp');
|
||||||
|
const { merge } = require('lodash');
|
||||||
const { env } = require('@strapi/utils');
|
const { env } = require('@strapi/utils');
|
||||||
const loadConfigFile = require('../../app-configuration/load-config-file');
|
const loadConfigFile = require('../../app-configuration/load-config-file');
|
||||||
const loadFiles = require('../../../load/load-files');
|
const loadFiles = require('../../../load/load-files');
|
||||||
@ -71,14 +72,19 @@ const getUserPluginsConfig = async () => {
|
|||||||
strapi.dirs.config,
|
strapi.dirs.config,
|
||||||
`env/${process.env.NODE_ENV}/plugins.js`
|
`env/${process.env.NODE_ENV}/plugins.js`
|
||||||
);
|
);
|
||||||
|
let config = {};
|
||||||
|
|
||||||
if (await fse.pathExists(currentEnvUserConfigPath)) {
|
// assign global user config if exists
|
||||||
return loadConfigFile(currentEnvUserConfigPath);
|
if (await fse.pathExists(globalUserConfigPath)) {
|
||||||
} else if (await fse.pathExists(globalUserConfigPath)) {
|
config = loadConfigFile(globalUserConfigPath);
|
||||||
return loadConfigFile(globalUserConfigPath);
|
|
||||||
} else {
|
|
||||||
return {};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// and merge user config by environment if exists
|
||||||
|
if (await fse.pathExists(currentEnvUserConfigPath)) {
|
||||||
|
config = merge(config, loadConfigFile(currentEnvUserConfigPath));
|
||||||
|
}
|
||||||
|
|
||||||
|
return config;
|
||||||
};
|
};
|
||||||
|
|
||||||
const applyUserConfig = async plugins => {
|
const applyUserConfig = async plugins => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user