UNPKG

@strapi/strapi

Version:

An open source headless CMS solution to create and manage your own API. It provides a powerful dashboard and features to make your life easier. Databases supported: MySQL, MariaDB, PostgreSQL, SQLite

1 lines 1.08 kB
{"version":3,"file":"config.mjs","sources":["../../../../src/node/core/config.ts"],"sourcesContent":["import path from 'node:path';\n\nimport type { BuildContext } from '../create-build-context';\nimport { loadFile } from './files';\n\nconst getUserConfig = async <TConfig>(\n fileNames: string[],\n ctx: BuildContext\n): Promise<TConfig | undefined> => {\n for (const file of fileNames) {\n const filePath = path.join(ctx.appDir, 'src', 'admin', file);\n const configFile = await loadFile(filePath);\n\n if (configFile) {\n return configFile;\n }\n }\n\n return undefined;\n};\n\nexport { getUserConfig };\n"],"names":["getUserConfig","fileNames","ctx","file","filePath","path","join","appDir","configFile","loadFile","undefined"],"mappings":";;;AAKMA,MAAAA,aAAAA,GAAgB,OACpBC,SACAC,EAAAA,GAAAA,GAAAA;IAEA,KAAK,MAAMC,QAAQF,SAAW,CAAA;QAC5B,MAAMG,QAAAA,GAAWC,KAAKC,IAAI,CAACJ,IAAIK,MAAM,EAAE,OAAO,OAASJ,EAAAA,IAAAA,CAAAA;QACvD,MAAMK,UAAAA,GAAa,MAAMC,QAASL,CAAAA,QAAAA,CAAAA;AAElC,QAAA,IAAII,UAAY,EAAA;YACd,OAAOA,UAAAA;AACT;AACF;IAEA,OAAOE,SAAAA;AACT;;;;"}