@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
26 lines (23 loc) • 695 B
JavaScript
import path from 'node:path';
import { pathExists, convertSystemPathToModulePath } from './files.mjs';
const ADMIN_APP_FILES = [
'app.js',
'app.mjs',
'app.ts',
'app.jsx',
'app.tsx'
];
const loadUserAppFile = async ({ runtimeDir, appDir })=>{
for (const file of ADMIN_APP_FILES){
const filePath = path.join(appDir, 'src', 'admin', file);
if (await pathExists(filePath)) {
return {
path: filePath,
modulePath: convertSystemPathToModulePath(path.relative(runtimeDir, filePath))
};
}
}
return undefined;
};
export { loadUserAppFile };
//# sourceMappingURL=admin-customisations.mjs.map