Nuxt/packages/cli/src/commands/index.ts

26 lines
512 B
TypeScript
Raw Normal View History

import type { Argv } from 'mri'
2021-04-09 15:52:45 +00:00
export const commands = {
dev: () => import('./dev'),
build: () => import('./build'),
usage: () => import('./usage')
}
export type Command = keyof typeof commands
export interface NuxtCommandMeta {
name: string;
usage: string;
description: string;
[key: string]: any;
}
export interface NuxtCommand {
invoke(args: Argv): Promise<void> | void
meta: NuxtCommandMeta
}
export function defineNuxtCommand (command: NuxtCommand): NuxtCommand {
return command
}