(id: string)
| 7 | const assetsById: Record<string, Asset[]> = {}; |
| 8 | |
| 9 | const getAssets = async (id: string) => { |
| 10 | if (assetsById[id]) return assetsById[id]; |
| 11 | |
| 12 | const manifest = getManifest(import.meta.env.SSR && import.meta.env.DEV ? "ssr" : "client"); |
| 13 | const assets = await manifest.getAssets(id); |
| 14 | if (import.meta.env.PROD) assetsById[id] = assets; |
| 15 | |
| 16 | return assets; |
| 17 | }; |
| 18 | |
| 19 | const withAssets = function <T extends () => Promise<{ default: Component<any> }>>(fn: T): T { |
| 20 | const wrapper = async () => { |