未验证 提交 42b3b162 编写于 作者: S Sadra Bahrami 提交者: GitHub

Remove extra work on cli functions (#22855)

Hi I saw you wrote extra async await code for command line function that doesn't need. I fixed that and code become very smaller and prettier.
![ts](https://user-images.githubusercontent.com/48912836/110254867-442c8880-7fa6-11eb-9f0f-3b853d5db94c.png)
上级 87ccebf5
......@@ -17,13 +17,11 @@ import opentelemetryApi from '@opentelemetry/api'
const defaultCommand = 'dev'
export type cliCommand = (argv?: string[]) => void
const commands: { [command: string]: () => Promise<cliCommand> } = {
build: async () => await import('../cli/next-build').then((i) => i.nextBuild),
start: async () => await import('../cli/next-start').then((i) => i.nextStart),
export: async () =>
await import('../cli/next-export').then((i) => i.nextExport),
dev: async () => await import('../cli/next-dev').then((i) => i.nextDev),
telemetry: async () =>
await import('../cli/next-telemetry').then((i) => i.nextTelemetry),
build: () => import('../cli/next-build').then((i) => i.nextBuild),
start: () => import('../cli/next-start').then((i) => i.nextStart),
export: () => import('../cli/next-export').then((i) => i.nextExport),
dev: () => import('../cli/next-dev').then((i) => i.nextDev),
telemetry: () => import('../cli/next-telemetry').then((i) => i.nextTelemetry),
}
const args = arg(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册