In daily development, we have to test ourselves, and often come across the situation of deciding whether the current project environment is production or test environment.

 // Note: (the embedded web page runs on the web server inside the app, with the address of 127.0.0.1:60000. The environment cannot be judged by the domain name)
export const isEnvProduction =
  process.env.TARGET_APP_ENV === 'production' ||
  location.host === 'Production domain name'

export const isEnvSit =
  process.env.TARGET_APP_ENV === 'development' ||
  location.host === 'Test domain name'
Copy the code

Note: (The embedded Web page runs on the Web server within the APP with the address of 127.0.0.1:60000, so the environment cannot be judged by the domain name)