fix(build): add BASE_HREF placeholder + config.js tag to index.html
The build asserts on <!--BASE_HREF--> and placement fails without it, so nothing was ever placed and nginx 404'd. The ./config.js tag is the other half: it carries this environment's VITE_ZINO_API_URL, and without it requireConfigValue throws and the app renders nothing even once served. Order matters — the placeholder precedes the favicon href, or that relative ref resolves against the wrong root once mounted. Verified by simulating placement locally: filled the placeholder, wrote a config.js beside the artifact, served it under /zurich-kotak/ and loaded it. index.html, the JS bundle, config.js and the favicon all 200, the login renders, and with config.js removed the root stays empty rather than falling back to some other backend. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
49cfdc8c00
commit
42cfef12bf
16
index.html
16
index.html
@ -2,9 +2,23 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/webp" href="./brand/zurich_logo.webp" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<!-- Placeholder the server rewrites into the document base tag for this
|
||||||
|
mount when it places the built artifact. The build asserts on its
|
||||||
|
presence, so removing it fails placement rather than shipping
|
||||||
|
something broken.
|
||||||
|
|
||||||
|
It must stay AHEAD of every relative URL in the document — the favicon
|
||||||
|
below resolves against it, and against the wrong root without it. -->
|
||||||
|
<!--BASE_HREF-->
|
||||||
|
<link rel="icon" type="image/webp" href="./brand/zurich_logo.webp" />
|
||||||
<title>Zurich Kotak | Lead Desk</title>
|
<title>Zurich Kotak | Lead Desk</title>
|
||||||
|
<!-- Written next to the artifact at placement; carries this environment's
|
||||||
|
VITE_ZINO_API_URL, which src/runtimeConfig.js reads off
|
||||||
|
window.__RUNTIME_CONFIG__. Without it requireConfigValue throws and the
|
||||||
|
app renders nothing — which is the intended failure, but only if the
|
||||||
|
tag is here to be filled. Vite leaves this non-module tag alone. -->
|
||||||
|
<script src="./config.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user