Skip to content

Commit 400e349

Browse files
committed
enable hmr for dashboard
1 parent 82505b4 commit 400e349

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

components/dashboard/craco.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@ module.exports = {
4747
],
4848
},
4949
},
50+
devServer: {
51+
client: {
52+
webSocketURL: {
53+
hostname: process.env.HMR_HOST ? new URL(process.env.HMR_HOST).hostname : "localhost",
54+
port: process.env.HMR_HOST ? 443 : 3000,
55+
protocol: "wss",
56+
},
57+
},
58+
},
5059
...when(process.env.GP_DEV_HOST && process.env.GP_DEV_COOKIE, () => ({
5160
devServer: {
5261
proxy: {

components/dashboard/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"web-vitals": "^1.1.1"
8484
},
8585
"scripts": {
86-
"start": "craco start",
86+
"start": "BROWSER=none HMR_HOST=`gp url 3000` craco start",
8787
"build": "craco build --verbose",
8888
"lint": "eslint --max-warnings=0 --ext=.jsx,.js,.tsx,.ts ./src",
8989
"test": "yarn test:unit",

0 commit comments

Comments
 (0)