perf: check app config file

This commit is contained in:
lisonge 2024-01-09 10:06:31 +08:00
parent 38ace74d98
commit 935259f081

View File

@ -8,6 +8,9 @@ import type { RawApp } from './types';
const rawApps: RawApp[] = [];
for await (const tsFp of walk(process.cwd() + '/src/apps')) {
if (!tsFp.endsWith('.ts')) {
throw new Error('invalid typescript app config file: ' + tsFp);
}
const mod: { default: RawApp } = await import(url.pathToFileURL(tsFp).href);
const appConfig = mod.default;
if (path.basename(tsFp, '.ts') != appConfig.id) {