Skip to content

Commit

Permalink
chore(shortcuts): resolve generic type error (#14802)
Browse files Browse the repository at this point in the history
Co-authored-by: liangzhengtai <liangzhengtai@didiglobal.com>
  • Loading branch information
lzt1008 and liangzhengtai committed Oct 30, 2023
1 parent 7881457 commit a090742
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/vite/src/node/shortcuts.ts
Expand Up @@ -46,9 +46,11 @@ export function bindCLIShortcuts<Server extends ViteDevServer | PreviewServer>(
)
}

const shortcuts = (opts?.customShortcuts ?? [])
// @ts-expect-error passing the right types, but typescript can't detect it
.concat(isDev ? BASE_DEV_SHORTCUTS : BASE_PREVIEW_SHORTCUTS)
const shortcuts = (opts?.customShortcuts ?? []).concat(
(isDev
? BASE_DEV_SHORTCUTS
: BASE_PREVIEW_SHORTCUTS) as CLIShortcut<Server>[],
)

let actionRunning = false

Expand Down

0 comments on commit a090742

Please sign in to comment.