From 400e3499be21281c60c9bb52a45174e4032231b4 Mon Sep 17 00:00:00 2001 From: Brad Harris Date: Thu, 7 Sep 2023 17:16:48 +0000 Subject: [PATCH] enable hmr for dashboard --- components/dashboard/craco.config.js | 9 +++++++++ components/dashboard/package.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/components/dashboard/craco.config.js b/components/dashboard/craco.config.js index 842e08843a7960..ec065280ed4566 100644 --- a/components/dashboard/craco.config.js +++ b/components/dashboard/craco.config.js @@ -47,6 +47,15 @@ module.exports = { ], }, }, + devServer: { + client: { + webSocketURL: { + hostname: process.env.HMR_HOST ? new URL(process.env.HMR_HOST).hostname : "localhost", + port: process.env.HMR_HOST ? 443 : 3000, + protocol: "wss", + }, + }, + }, ...when(process.env.GP_DEV_HOST && process.env.GP_DEV_COOKIE, () => ({ devServer: { proxy: { diff --git a/components/dashboard/package.json b/components/dashboard/package.json index 77e13016658591..aea8950da1ccb3 100644 --- a/components/dashboard/package.json +++ b/components/dashboard/package.json @@ -83,7 +83,7 @@ "web-vitals": "^1.1.1" }, "scripts": { - "start": "craco start", + "start": "BROWSER=none HMR_HOST=`gp url 3000` craco start", "build": "craco build --verbose", "lint": "eslint --max-warnings=0 --ext=.jsx,.js,.tsx,.ts ./src", "test": "yarn test:unit",