import { cp, mkdir, rm } from 'node:fs/promises'; import { fileURLToPath } from 'node:url'; import { applications, validateApplications } from '../src/apps.mjs'; validateApplications(applications); const root = new URL('../', import.meta.url); const output = new URL('dist/', root); await rm(output, { recursive: true, force: true }); await mkdir(output, { recursive: true }); for (const name of ['index.html', 'favicon.svg', 'src']) { await cp(new URL(name, root), new URL(name, output), { recursive: true }); } console.log(`构建成功:${fileURLToPath(output)}(${applications.length} 个应用)`);