Skip to content

Commit 0a708b0

Browse files
committed
refactor(web): update API base URL handling and enhance logging in webpack config
This commit modifies the API base URL assignment in the webpack configuration to use `process.env.BASEURL` instead of a localhost fallback. Additionally, it improves error logging for unrecognized environment names by ensuring proper message formatting and adds a console log for the environment object, aiding in debugging and configuration clarity.
1 parent 29d378d commit 0a708b0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/web/webpack.config.mjs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const loadEnvFile = (envName) => {
2424
// Handle unmapped environment names explicitly
2525
if (typeof envFile === "undefined") {
2626
console.error(
27-
`Error: Unrecognized environment name '${envName}'. Valid options are: ${Object.keys(map).join(", ")}.`
27+
`Error: Unrecognized environment name '${envName}'. Valid options are: ${Object.keys(map).join(", ")}.`,
2828
);
2929
return;
3030
}
@@ -65,8 +65,7 @@ export default (env, argv) => {
6565
const GLOBAL_SCSS = resolvePath("src/common/styles/index.scss");
6666

6767
const ANALYZE_BUNDLE = env.analyze;
68-
const API_BASEURL =
69-
process.env.API_BASEURL || `http://localhost:${process.env.PORT || 3000}`;
68+
const API_BASEURL = process.env.BASEURL;
7069
const GOOGLE_CLIENT_ID = process.env.GOOGLE_CLIENT_ID;
7170
const POSTHOG_KEY = process.env.POSTHOG_KEY;
7271
const POSTHOG_HOST = process.env.POSTHOG_HOST;

0 commit comments

Comments
 (0)