refactor: handle async

This commit is contained in:
cha0s 2021-03-23 00:37:11 -05:00
parent 5e01ba0c35
commit b88020f42a

View File

@ -17,6 +17,9 @@ module.exports = process.env.LATUS_LINTING
const latus = Latus.create();
const configs = {server};
latus.invokeFlat('@latus/core/build', configs);
Promise.all(Object.entries(configs).map(async ([k, v]) => [k, await v]))
.then(Object.fromEntries)
.then((configs) => {
const webpackConfigs = Object.values(
Object.entries(configs)
.reduce(
@ -34,6 +37,7 @@ module.exports = process.env.LATUS_LINTING
if (1 === webpackConfigs.length) {
resolve(webpackConfigs[0]);
}
});
}
catch (error) {
reject(error);