| 4 | |
| 5 | // During the build process, we inject the build info into the HTML |
| 6 | export const getStaticBuildInfo = () => { |
| 7 | if (CACHED_BUILD_INFO) { |
| 8 | return CACHED_BUILD_INFO; |
| 9 | } |
| 10 | |
| 11 | const buildInfoJson = document |
| 12 | .querySelector("meta[property=build-info]") |
| 13 | ?.getAttribute("content"); |
| 14 | |
| 15 | if (buildInfoJson) { |
| 16 | try { |
| 17 | CACHED_BUILD_INFO = JSON.parse(buildInfoJson) as BuildInfoResponse; |
| 18 | } catch { |
| 19 | return undefined; |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | return CACHED_BUILD_INFO; |
| 24 | }; |
| 25 | |
| 26 | type PrereleaseFlag = "devel" | "rc" | undefined; |
| 27 | |