UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

2 lines 970 B
import{copy as e}from"../../i18n/copy.mjs";import{createTranslator as t}from"../../i18n/translate.mjs";import n from"../../cli/logger.mjs";const r=async r=>{try{let e=[],i=r.silent??!1,a=t({store:r.translationStore,locale:`en`});return await Promise.all(r.config.plugins.map(async t=>{if(!t.hooks?.runtime)return;let o=await t.hooks.runtime({phase:`build`,definition:r.definition,paths:{configPath:r.configPath,outputPath:r.outputPath,outputRelativeConfigPath:r.outputRelativeConfigPath}});o.error&&n.error(a.english(o.error.message)??`An unknown error occurred while running the ${t.key} plugin runtime hook`,{silent:i}),o.data?.artifacts&&e.push(...o.data.artifacts)})),{error:void 0,data:e}}catch(t){return{error:{message:e(`server:core.plugins.build.failed`,{defaultMessage:t instanceof Error?t.message:`An unknown error occurred while preparing plugin runtime artifacts`}),status:500},data:void 0}}};export{r as default}; //# sourceMappingURL=handle-runtime.mjs.map