Skip to content

Commit a666abf

Browse files
committed
chore: delay dev browser open by 3s
1 parent 013d6ff commit a666abf

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

cli.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10262,7 +10262,12 @@ function createWebServer({ htmlPath, assetsDir, webDir, host, port, openBrowser
1026210262

1026310263
if (!process.env.CODEXMATE_NO_BROWSER && openBrowser) {
1026410264
const url = openUrl;
10265-
openBrowserAfterReady(url);
10265+
// npm run dev: delay opening the browser to avoid racing early startup logs / initialization.
10266+
if (process.env.npm_lifecycle_event === 'dev') {
10267+
setTimeout(() => openBrowserAfterReady(url), 3000);
10268+
} else {
10269+
openBrowserAfterReady(url);
10270+
}
1026610271
}
1026710272
});
1026810273

0 commit comments

Comments
 (0)