fix: yarn dev --client error

This commit is contained in:
chenos 2023-08-25 09:44:47 +08:00
parent f4a1953980
commit e596025bd4
2 changed files with 1 additions and 2 deletions

View File

@ -97,7 +97,7 @@ module.exports = (cli) => {
env: {
PORT: clientPort,
APP_ROOT: `${APP_PACKAGE_ROOT}/client`,
WEBSOCKET_URL: process.env.WEBSOCKET_URL || `ws://localhost:${serverPort}/ws`,
WEBSOCKET_URL: process.env.WEBSOCKET_URL || (serverPort ? `ws://localhost:${serverPort}/ws` : undefined),
PROXY_TARGET_URL:
process.env.PROXY_TARGET_URL || (serverPort ? `http://127.0.0.1:${serverPort}` : undefined),
},

View File

@ -7,7 +7,6 @@ export const getWebSocketURL = () => {
}
const subApp = getSubAppName();
const queryString = subApp ? `?__appName=${subApp}` : '';
console.log(queryString);
if (process.env.WEBSOCKET_URL) {
return `${process.env.WEBSOCKET_URL}${queryString}`;
}