mirror of
https://github.com/slidevjs/slidev.git
synced 2026-09-14 20:46:32 +08:00
13 lines
421 B
TypeScript
13 lines
421 B
TypeScript
import fs from 'node:fs/promises'
|
|
import { fileURLToPath } from 'node:url'
|
|
import fg from 'fast-glob'
|
|
|
|
const files = await fg('*.vue', {
|
|
cwd: fileURLToPath(new URL('../packages/client/layouts', import.meta.url)),
|
|
})
|
|
|
|
await fs.writeFile(new URL('../packages/types/src/builtin-layouts.ts', import.meta.url), `
|
|
export type BuiltinLayouts =
|
|
${files.sort().map(i => ` | '${i.replace('.vue', '')}'`).join('\n')}
|
|
`, 'utf-8')
|