Skip to content

Commit

Permalink
refactor: code
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Nov 3, 2020
1 parent b804b34 commit e175cb3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions packages/webpack-cli/lib/groups/resolveConfig.js
Expand Up @@ -158,7 +158,7 @@ const finalize = async (moduleObj, args) => {

let configs = [];

await Promise.all(
const allConfigs = await Promise.all(
rawConfigs.map(async (rawConfig) => {
const isPromise = typeof rawConfig.then === 'function';

Expand All @@ -174,15 +174,15 @@ const finalize = async (moduleObj, args) => {

return rawConfig;
}),
).then((allConfigs) => {
allConfigs.map((singleConfig) => {
if (Array.isArray(singleConfig)) {
singleConfig.map((conf) => configs.push(conf));
} else {
configs.push(singleConfig);
}
});
});
);

for (const singleConfig of allConfigs) {
if (Array.isArray(singleConfig)) {
configs.push(...singleConfig);
} else {
configs.push(singleConfig);
}
}

if (configName) {
const foundConfigNames = [];
Expand Down

0 comments on commit e175cb3

Please sign in to comment.