Skip to content

Commit 1142d83

Browse files
ras0qkermanx
andauthored
fix(vscode): should pass entry file name to CLI (#1677)
Co-authored-by: ras0q <ras0q@users.noreply.github.com> Co-authored-by: _Kerman <kermanx@qq.com>
1 parent b38d094 commit 1142d83

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/vscode/src/composables/useDevServer.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { basename } from 'node:path'
12
import type { Ref } from '@vue/runtime-core'
23
import { toRef } from '@vue/runtime-core'
34
import { getPort as getPortPlease } from 'get-port-please'
@@ -28,7 +29,7 @@ export function useDevServer(project: SlidevProject) {
2829
if (isTerminalActive())
2930
return
3031
port.value ??= await getPort()
31-
sendText(`npm exec slidev -- --port ${port.value}`)
32+
sendText(`npm exec slidev -- --port ${port.value} ${JSON.stringify(basename(project.entry))}`)
3233
}
3334

3435
function stop() {

0 commit comments

Comments
 (0)