Skip to content

Commit

Permalink
Remove extra work on cli functions (#22855)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
sromexs committed Mar 8, 2021
1 parent 87ccebf commit 42b3b16
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/next/bin/next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 42b3b16

Please sign in to comment.