Files
fullstack-starter/src/bin.ts
T

21 lines
632 B
TypeScript

import { defineCommand, runMain } from 'citty'
import { name, version } from '#package'
// IMPORTANT: keep this file's static imports minimal. Nitro's bun preset
// emits `.output/server/index.mjs` with a top-level `serve(...)` call, so any
// eager (transitive) import of it would start the HTTP server even for
// `--help`. All subcommands are lazy-loaded via citty.
const main = defineCommand({
meta: {
name,
version,
description: 'Fullstack server binary (default subcommand: serve)',
},
default: 'serve',
subCommands: {
serve: () => import('@/cli/serve').then((m) => m.default),
},
})
runMain(main)