Skip to content

Commit 510e719

Browse files
committedAug 27, 2024··
fix: only add preload links on server
1 parent a2b79b6 commit 510e719

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

Diff for: ‎src/runtime/components/NuxtImg.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const mainSrc = computed(() =>
103103
104104
const src = computed(() => placeholder.value ? placeholder.value : mainSrc.value)
105105
106-
if (props.preload) {
106+
if (import.meta.server && props.preload) {
107107
const isResponsive = Object.values(sizes.value).every(v => v)
108108
109109
useHead({

Diff for: ‎src/runtime/components/NuxtPicture.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const sources = computed<Source[]>(() => {
9191
9292
const lastSourceIndex = computed(() => sources.value.length - 1)
9393
94-
if (props.preload) {
94+
if (import.meta.server && props.preload) {
9595
const link: NonNullable<Head['link']>[number] = {
9696
rel: 'preload',
9797
as: 'image',

0 commit comments

Comments
 (0)
Please sign in to comment.