perf(nuxt): cache result of importing styles module (#18734)

This commit is contained in:
Daniel Roe 2023-02-03 04:50:17 -08:00 committed by GitHub
parent 03d6737089
commit 2b75414f47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,7 +69,7 @@ const getStaticRenderedHead = (): Promise<NuxtMeta> => import('#head-static').th
const getServerEntry = () => import('#build/dist/server/server.mjs').then(r => r.default || r)
// @ts-ignore
const getSSRStyles = (): Promise<Record<string, () => Promise<string[]>>> => import('#build/dist/server/styles.mjs').then(r => r.default || r)
const getSSRStyles = lazyCachedFunction((): Promise<Record<string, () => Promise<string[]>>> => import('#build/dist/server/styles.mjs').then(r => r.default || r))
// -- SSR Renderer --
const getSSRRenderer = lazyCachedFunction(async () => {