Skip to content

Commit 391717c

Browse files
fix(nuxt): use placeholderSize for SSR generation
1 parent 6ee51ff commit 391717c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/nuxt/src/runtime/components/UnLazyImage.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,14 @@ const isSSR = process.server && (props.ssr ?? unlazy.ssr)
5151
// const now = performance.now()
5252
const pngPlaceholder = (isSSR && (props.thumbhash || props.blurhash))
5353
? props.blurhash
54-
? createPngDataUriFromBlurHash(props.blurhash, { ratio: props.placeholderRatio })
54+
? createPngDataUriFromBlurHash(props.blurhash, {
55+
size: props.placeholderSize || unlazy.placeholderSize,
56+
ratio: props.placeholderRatio,
57+
})
5558
: createPngDataUriFromThumbHash(props.thumbhash!)
5659
: undefined
5760
58-
// if (isSSR)
61+
// if (isSSR && process.dev)
5962
// console.log(`[unlazy] BlurHash decoded in ${performance.now() - now}ms`)
6063
6164
onMounted(() => {

0 commit comments

Comments
 (0)