@lucidcms/core
Version:
The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.
2 lines • 934 B
JavaScript
import e from"../logger.mjs";import t from"node:fs/promises";import n from"node:path";const r=[`file`,`compile`],i=async i=>{let a={compile:{},custom:[]};return await Promise.all(i.artifacts.map(async o=>{if(i.customArtifactTypes?.includes(o.type)){a.custom.push(o);return}if(!r.includes(o.type))return;let s;if(o.type===`compile`){let e=o,t=n.dirname(e.path),r=n.basename(e.path);s={path:n.join(t,`temp-${r}`),content:e.content}}else if(o.type===`file`)s={path:o.path,content:o.content};else return;let c=s.path.replace(/^[/\\]+/,``),l=n.join(i.outDir,c);if(await t.mkdir(n.dirname(l),{recursive:!0}),await t.writeFile(l,s.content),e.info(`Plugin artifact built:`,e.color.green(`./${c}`),{silent:i.silent}),o.type===`compile`){let e=o,t=n.extname(e.path),r=n.basename(e.path,t),i=n.dirname(e.path),s=n.join(i,r);a.compile[s]=l}})),a};export{r as CORE_ARTIFACT_TYPES,i as default};
//# sourceMappingURL=process-build-artifacts.mjs.map