| 1 | // Minimal client entry. The cloudflare-vite-plugin handles the worker |
| 2 | // runtime separately; this file just satisfies the `index.html` script tag |
| 3 | // reference so Vite emits a real client bundle. |
| 4 | // |
| 5 | // `import.meta.env.VITE_TEST_MARKER` is referenced here so the |
| 6 | // "Vite: env props" test can verify `Cloudflare.Website.Vite({ env })` actually |
| 7 | // reaches the client bundle. Vite inlines the value via the `define` |
| 8 | // hook at build time; the integration test fetches the deployed JS |
| 9 | // asset and asserts the value is present. |
| 10 | const marker = (import.meta.env as { VITE_TEST_MARKER?: string }) |
| 11 | .VITE_TEST_MARKER; |
| 12 | const el = document.getElementById("app"); |
| 13 | if (el) { |
| 14 | el.textContent = `${el.textContent} (hydrated, marker=${marker ?? ""})`; |
| 15 | } |