Skip to content

Commit 0046051

Browse files
committed
fix(devserver): expose startupTimeout
1 parent 4fc3dc0 commit 0046051

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/declarations/stencil-public-compiler.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,12 @@ export interface StencilDevServerConfig {
421421
*/
422422
ssr?: boolean;
423423
/**
424-
* If to use the dev server's websocket client or not. Defaults to `true`.
424+
* If the dev server fails to start up within the given timout (in milliseconds), the startup will
425+
* be canceled. Set to zero to disable the timeout. Defaults to `15000`.
426+
*/
427+
startupTimeout?: number;
428+
/**
429+
* Whether to use the dev server's websocket client or not. Defaults to `true`.
425430
*/
426431
websocket?: boolean;
427432
/**
@@ -440,7 +445,6 @@ export interface DevServerConfig extends StencilDevServerConfig {
440445
prerenderConfig?: string;
441446
protocol?: 'http' | 'https';
442447
srcIndexHtml?: string;
443-
startupTimeout?: number;
444448
}
445449

446450
export interface HistoryApiFallback {

src/dev-server/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ function startServer(
5353
const timespan = logger.createTimeSpan(`starting dev server`, true);
5454

5555
const startupTimeout =
56-
logger.getLevel() !== 'debug'
56+
logger.getLevel() !== 'debug' || devServerConfig.startupTimeout !== 0
5757
? setTimeout(() => {
5858
reject(`dev server startup timeout`);
59-
}, devServerConfig.startupTimeout || 15000)
59+
}, devServerConfig.startupTimeout ?? 15000)
6060
: null;
6161

6262
let isActivelyBuilding = false;

0 commit comments

Comments
 (0)