Skip to content

Commit

Permalink
make the show url output better (use listhen's functionality)
Browse files Browse the repository at this point in the history
  • Loading branch information
nksaraf committed Dec 27, 2023
1 parent 45ad5dc commit 4002dc1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/vinxi/bin/cli.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ const command = defineCommand({
const app = await loadApp(configFile, args);

let devServer;
/** @type {import('@vinxi/listhen').Listener} */
let listener;
/** @type {import('chokidar').FSWatcher} */
let watcher;

Expand All @@ -92,9 +94,7 @@ const command = defineCommand({
restartDevServer(app);
break;
case "u":
log(
`http://localhost:${args.port ?? process.env.PORT ?? 3000}`,
);
listener.showURL();
break;
case "q":
process.exit(0);
Expand All @@ -115,7 +115,7 @@ const command = defineCommand({
port: Number(args.port ?? process.env.PORT ?? 3000),
});
log("restarting dev server");
devServer.listen();
listener = await devServer.listen();
}

if (!app) {
Expand Down Expand Up @@ -146,7 +146,7 @@ const command = defineCommand({
port: Number(args.port ?? process.env.PORT ?? 3000),
devtools: args.devtools || Boolean(process.env.DEVTOOLS),
});
devServer.listen();
listener = await devServer.listen();
},
},
build: {
Expand Down

0 comments on commit 4002dc1

Please sign in to comment.