Skip to content

Commit 501ac62

Browse files
committed
support configuring HMR host and proto
1 parent c3fca96 commit 501ac62

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • packages/admin/admin-bundler/src/utils

packages/admin/admin-bundler/src/utils/config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ export async function getViteConfig(
1313
const { default: medusa } = await import("@medusajs/admin-vite-plugin")
1414

1515
const getPort = await import("get-port")
16-
const hmrPort = process.env.HMR_PORT || (await getPort.default())
16+
const hmrPort = process.env.HMR_PORT
17+
? parseInt(process.env.HMR_PORT)
18+
: await getPort.default()
1719

1820
const root = path.resolve(process.cwd(), ".medusa/client")
1921

@@ -51,6 +53,10 @@ export async function getViteConfig(
5153
},
5254
hmr: {
5355
port: hmrPort,
56+
...(process.env.HMR_PROTOCOL
57+
? { protocol: process.env.HMR_PROTOCOL }
58+
: {}),
59+
...(process.env.HMR_HOST ? { host: process.env.HMR_HOST } : {}),
5460
},
5561
},
5662
plugins: [

0 commit comments

Comments
 (0)