()
| 181 | // code branches that use the Build Manifest Callback and push them through |
| 182 | // the Route Loader interface. |
| 183 | export function getClientBuildManifest() { |
| 184 | if (self.__BUILD_MANIFEST) { |
| 185 | return Promise.resolve(self.__BUILD_MANIFEST) |
| 186 | } |
| 187 | |
| 188 | const onBuildManifest = new Promise<Record<string, string[]>>((resolve) => { |
| 189 | // Mandatory because this is not concurrent safe: |
| 190 | const cb = self.__BUILD_MANIFEST_CB |
| 191 | self.__BUILD_MANIFEST_CB = () => { |
| 192 | resolve(self.__BUILD_MANIFEST!) |
| 193 | cb && cb() |
| 194 | } |
| 195 | }) |
| 196 | |
| 197 | return resolvePromiseWithTimeout( |
| 198 | onBuildManifest, |
| 199 | markAssetError(new Error('Failed to load client build manifest')), |
| 200 | devBuildPromise |
| 201 | ) |
| 202 | } |
| 203 | |
| 204 | interface RouteFiles { |
| 205 | scripts: (TrustedScriptURL | string)[] |
no test coverage detected