react-cosmos
Version:
Sandbox for developing and testing UI components in isolation
15 lines (14 loc) • 450 B
JavaScript
export async function applyServerConfigPlugins({ config, serverPlugins, mode, platform, }) {
for (const plugin of serverPlugins) {
if (plugin.config) {
try {
config = await plugin.config({ config, mode, platform });
}
catch (err) {
console.log(`[Cosmos][${plugin.name}] Config hook failed`);
throw err;
}
}
}
return config;
}