Skip to content
This repository was archived by the owner on Aug 16, 2024. It is now read-only.

Commit 0da967e

Browse files
committed
feat: add host and port to start and dev command
1 parent a08c124 commit 0da967e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/cli.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ const { config } = await loadConfig<VueSsrConfig>({ name: 'vue-ssr' })
1111
const args = mri(argv.slice(2));
1212
const command = args._[0];
1313

14+
const { host, port } = args
15+
1416
if (command === 'build') {
1517
await build(config?.vite)
1618
} else if (command === 'start') {
17-
await start(config?.port ?? 5173, config?.hostname ?? 'localhost')
19+
await start(port ?? config?.port ?? 5173, host ?? config?.hostname ?? 'localhost')
1820
} else {
19-
await dev({ port: config?.port ?? 5173, hostname: config?.hostname ?? 'localhost', viteConfig: config?.vite })
21+
await dev({ port: port ?? config?.port ?? 5173, hostname: host ?? config?.hostname ?? 'localhost', viteConfig: config?.vite })
2022
}

0 commit comments

Comments
 (0)