diff --git a/packages/cli/package.json b/packages/cli/package.json index 23c5c5d6af..516e354012 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -169,6 +169,22 @@ "visibility": "frontend", "description": "Tracking ID for Google Analytics", "example": "UA-000000-0" + }, + "listen": { + "type": "object", + "description": "Listening configuration for local development", + "properties": { + "host": { + "type": "number", + "visibility": "frontend", + "description": "The host that the frontend should be bound to. Only used for local development." + }, + "post": { + "type": "number", + "visibility": "frontend", + "description": "The port that the frontend should be bound to. Only used for local development." + } + } } } } diff --git a/packages/cli/src/lib/bundler/server.ts b/packages/cli/src/lib/bundler/server.ts index f540e01084..d198f5507c 100644 --- a/packages/cli/src/lib/bundler/server.ts +++ b/packages/cli/src/lib/bundler/server.ts @@ -26,9 +26,9 @@ export async function serveBundle(options: ServeOptions) { const url = resolveBaseUrl(options.frontendConfig); const host = - options.config.getOptionalString('app.listen.host') || url.hostname; + options.frontendConfig.getOptionalString('app.listen.host') || url.hostname; const port = - options.config.getOptionalNumber('app.listen.port') || + options.frontendConfig.getOptionalNumber('app.listen.port') || Number(url.port) || (url.protocol === 'https:' ? 443 : 80);