Skip to content

Commit 3e68add

Browse files
tmp
1 parent 16bc30e commit 3e68add

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
"start": "rsbuild dev",
6868
"dev": "DISABLE_ESLINT_PLUGIN=true TSC_COMPILE_ON_ERROR=true REACT_APP_BACKEND=http://localhost:8765 REACT_APP_META_BACKEND=undefined rsbuild dev",
6969
"build": "rm -rf build && DISABLE_ESLINT_PLUGIN=true CI=true rsbuild build",
70-
"//build:embedded": "echo 'PUBLIC_URL is a setting for create-react-app. Embedded version is built and hosted as is on ydb servers, with no way of knowing the final URL pattern. PUBLIC_URL=. keeps paths to all static relative, allowing servers to handle them as needed'",
7170
"build:embedded": "GENERATE_SOURCEMAP=false REACT_APP_BACKEND=http://localhost:8765 REACT_APP_META_BACKEND=undefined npm run build",
7271
"build:embedded-mc": "GENERATE_SOURCEMAP=false PUBLIC_URL=. REACT_APP_BACKEND= REACT_APP_META_BACKEND= npm run build",
7372
"build:embedded:archive": "npm run build:embedded && mv build embedded-ui && cp CHANGELOG.md embedded-ui/CHANGELOG.md && zip -r embedded-ui.zip embedded-ui && rm -rf embedded-ui",
@@ -83,8 +82,8 @@
8382
"typecheck": "tsc --noEmit",
8483
"prepare": "husky",
8584
"test:e2e:install": "npx playwright install --with-deps",
86-
"test:e2e": "npx playwright test --config=playwright.config.ts",
87-
"test:e2e:local": "PLAYWRIGHT_BASE_URL=http://localhost:3000/ npm run test:e2e"
85+
"test:e2e": "DEBUG=pw:webserver npx playwright test --config=playwright.config.ts",
86+
"test:e2e:local": "DEBUG=pw:webserver PLAYWRIGHT_BASE_URL=http://localhost:3000/ npm run test:e2e"
8887
},
8988
"lint-staged": {
9089
"*.{scss, css}": [

rsbuild.config.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,26 @@ import {pluginSass} from '@rsbuild/plugin-sass';
44
import {pluginSvgr} from '@rsbuild/plugin-svgr';
55
import MonacoWebpackPlugin from 'monaco-editor-webpack-plugin';
66

7+
const APP_VARS = [
8+
'DISABLE_ESLINT_PLUGIN',
9+
'TSC_COMPILE_ON_ERROR',
10+
'REACT_APP_DISABLE_CHECKS',
11+
12+
'REACT_APP_BACKEND',
13+
'REACT_APP_META_BACKEND',
14+
'META_YDB_BACKEND',
15+
];
16+
717
const prepareEnvVars = () => {
818
// Load values from .env
919
const {parsed} = loadEnv();
1020

1121
const result: Record<string, string> = {};
1222

13-
// Additionall stringify vars to prevent errors with invalid symbols
14-
// rsbuild parses values additionally
15-
Object.entries(parsed).forEach(([key, value]) => {
16-
result[key] = JSON.stringify(value);
23+
APP_VARS.forEach((name) => {
24+
// Use var from .env if no process var
25+
const value = process.env[name] ?? parsed[name];
26+
result[name] = JSON.stringify(value);
1727
});
1828

1929
return result;

0 commit comments

Comments
 (0)