This is an automated email from the ASF dual-hosted git repository.
shuai pushed a commit to branch feat/basepath
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git
The following commit(s) were added to refs/heads/feat/basepath by this push:
new 5a1a9f0b feat: ui env variables remove react_app prefix
5a1a9f0b is described below
commit 5a1a9f0b4b9465459770778e1b9d1a5df3e6a212
Author: shuai <[email protected]>
AuthorDate: Tue Apr 23 10:40:02 2024 +0800
feat: ui env variables remove react_app prefix
---
ui/.env.production | 2 +-
ui/scripts/env.js | 4 +---
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/ui/.env.production b/ui/.env.production
index 3d8f6a77..c371a163 100644
--- a/ui/.env.production
+++ b/ui/.env.production
@@ -2,4 +2,4 @@ TSC_COMPILE_ON_ERROR=true
ESLINT_NO_DEV_ERRORS=true
PUBLIC_URL=/
REACT_APP_API_URL=/
-REACT_APP_BASE_URL=/test
+REACT_APP_BASE_URL=
diff --git a/ui/scripts/env.js b/ui/scripts/env.js
index df97966c..c9838058 100644
--- a/ui/scripts/env.js
+++ b/ui/scripts/env.js
@@ -12,10 +12,8 @@ const config = yaml.load(fs.readFileSync(configFilePath,
'utf8'));
let envContent = 'TSC_COMPILE_ON_ERROR=true\nESLINT_NO_DEV_ERRORS=true\n';
for (const key in config.ui) {
const value = config.ui[key];
- envContent += `${key.toUpperCase()}=${value}\n`;
+ envContent += `${key !== 'public_url' ? 'REACT_APP_' :
''}${key.toUpperCase()}=${value}\n`;
}
// Write .env file
fs.writeFileSync(envFilePath, envContent);
-
-console.log(`Generated ${envFilePath}`);