Skip to content

Commit

Permalink
fix: only add preload links on server
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Aug 27, 2024
1 parent a2b79b6 commit 510e719
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/runtime/components/NuxtImg.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const mainSrc = computed(() =>
const src = computed(() => placeholder.value ? placeholder.value : mainSrc.value)
if (props.preload) {
if (import.meta.server && props.preload) {
const isResponsive = Object.values(sizes.value).every(v => v)
useHead({
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/NuxtPicture.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const sources = computed<Source[]>(() => {
const lastSourceIndex = computed(() => sources.value.length - 1)
if (props.preload) {
if (import.meta.server && props.preload) {
const link: NonNullable<Head['link']>[number] = {
rel: 'preload',
as: 'image',
Expand Down

0 comments on commit 510e719

Please sign in to comment.