Build lightweight AI agent admin

This commit is contained in:
Codex
2026-06-08 18:14:59 +08:00
commit e164840f43
2530 changed files with 435693 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
import { build } from 'vite';
function tracePlugin() {
const importers = [];
return {
name: 'trace-jiti-importer',
async resolveId(source, importer, options) {
if (source.includes('jiti') || importer?.includes('jiti')) {
console.log('[resolve]', JSON.stringify({ source, importer }));
}
const resolved = await this.resolve(source, importer, {
...options,
skipSelf: true,
});
if (resolved?.id?.includes('jiti') || source.includes('jiti')) {
console.log(
'[resolved]',
JSON.stringify({ source, importer, resolved: resolved?.id }),
);
}
return resolved;
},
moduleParsed(info) {
if (info.importedIds.some((id) => id.includes('jiti'))) {
importers.push({
id: info.id,
importedIds: info.importedIds.filter((id) => id.includes('jiti')),
});
console.log('[imports-jiti]', JSON.stringify(importers.at(-1)));
}
if (info.id.includes('jiti')) {
console.log('[module-jiti]', info.id);
console.log('[jiti-importers]', JSON.stringify(importers, null, 2));
}
},
};
}
await build({
configFile: './vite.config.mts',
mode: 'production',
plugins: [tracePlugin()],
build: {
write: false,
},
});