Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
fix: avoid registering global path helpers twice
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Oct 18, 2022
1 parent 142a993 commit 271f834
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/nuxt/src/core/templates.ts
Expand Up @@ -240,8 +240,11 @@ export const publicPathTemplate: NuxtTemplate = {
' return path.length ? joinURL(publicBase, ...path) : publicBase',
'}',

'globalThis.__buildAssetsURL = buildAssetsURL',
'globalThis.__publicAssetsURL = publicAssetsURL'
// On server these are registered directly in packages/nuxt/src/core/runtime/nitro/renderer.ts
'if (process.client) {',
' globalThis.__buildAssetsURL = buildAssetsURL',
' globalThis.__publicAssetsURL = publicAssetsURL',
'}'
].filter(Boolean).join('\n')
}
}
Expand Down

0 comments on commit 271f834

Please sign in to comment.