From a19f9e12c462c9a93ca29b195e48abd5c0249f6d Mon Sep 17 00:00:00 2001 From: Aaron Date: Sun, 7 Jul 2024 09:31:38 -0500 Subject: [PATCH] feat(config): `dev.server.hostname` (#807) --- packages/wxt/src/core/utils/building/resolve-config.ts | 2 +- packages/wxt/src/types/index.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/wxt/src/core/utils/building/resolve-config.ts b/packages/wxt/src/core/utils/building/resolve-config.ts index eab17c5d..8f382aaf 100644 --- a/packages/wxt/src/core/utils/building/resolve-config.ts +++ b/packages/wxt/src/core/utils/building/resolve-config.ts @@ -126,7 +126,7 @@ export async function resolveConfig( } devServerConfig = { port, - hostname: 'localhost', + hostname: mergedConfig.dev?.server?.hostname ?? 'localhost', }; } diff --git a/packages/wxt/src/types/index.ts b/packages/wxt/src/types/index.ts index 63a7e9f7..e43936ef 100644 --- a/packages/wxt/src/types/index.ts +++ b/packages/wxt/src/types/index.ts @@ -338,6 +338,12 @@ export interface InlineConfig { * Port to run the dev server on. Defaults to the first open port from 3000 to 3010. */ port?: number; + /** + * Hostname to run the dev server on. + * + * @default "localhost" + */ + hostname?: string; }; /** * Controls whether a custom keyboard shortcut command, `Alt+R`, is added during dev mode to