Unverified Commit 42b3b162 authored by Sadra Bahrami's avatar Sadra Bahrami Committed by 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)
parent 87ccebf5
...@@ -17,13 +17,11 @@ import opentelemetryApi from '@opentelemetry/api' ...@@ -17,13 +17,11 @@ import opentelemetryApi from '@opentelemetry/api'
const defaultCommand = 'dev' const defaultCommand = 'dev'
export type cliCommand = (argv?: string[]) => void export type cliCommand = (argv?: string[]) => void
const commands: { [command: string]: () => Promise<cliCommand> } = { const commands: { [command: string]: () => Promise<cliCommand> } = {
build: async () => await import('../cli/next-build').then((i) => i.nextBuild), build: () => import('../cli/next-build').then((i) => i.nextBuild),
start: async () => await import('../cli/next-start').then((i) => i.nextStart), start: () => import('../cli/next-start').then((i) => i.nextStart),
export: async () => export: () => import('../cli/next-export').then((i) => i.nextExport),
await import('../cli/next-export').then((i) => i.nextExport), dev: () => import('../cli/next-dev').then((i) => i.nextDev),
dev: async () => await import('../cli/next-dev').then((i) => i.nextDev), telemetry: () => import('../cli/next-telemetry').then((i) => i.nextTelemetry),
telemetry: async () =>
await import('../cli/next-telemetry').then((i) => i.nextTelemetry),
} }
const args = arg( const args = arg(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment