perf(nuxt): avoid duplicate useRuntimeConfig call (#24843)

This commit is contained in:
Michael Brevard 2023-12-20 23:20:57 +02:00 committed by GitHub
parent 8917e5f564
commit 2cab4cba12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,6 +14,7 @@ export function buildAssetsURL (...path: string[]): string {
}
export function publicAssetsURL (...path: string[]): string {
const publicBase = useRuntimeConfig().app.cdnURL as string || useRuntimeConfig().app.baseURL
const app = useRuntimeConfig().app
const publicBase = app.cdnURL as string || app.baseURL
return path.length ? joinURL(publicBase, ...path) : publicBase
}