最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

vuejs3 - ipx image optimisation not working on production for @nuxtimage@1.9.0 with runtime value for NUXT_IMAGE_DOMAINS? - Stac

programmeradmin3浏览0评论

I am trying to update the NUXT_IMAGE_DOMAINS with dynamic ENV values during runtime and I am able to do this correctly. But, when I do this, ipx is not working as expected.

I have added domains in the nuxt.config, and I have tried explicitely defining ipx provider in nuxt.config. I have test.ts, which handles updating ENV values dynamically based on the deployment environment (dev or prod).

When I run the local instance with DEV instance's ENV values, the ipx works as expected. When checked on chrome's dev console I could see the below,

srcset="/_ipx/rotate_null&w_200&f_webp/https://MY_BRANCH.DOMAIN/00a9b372-78d6-46ec-a3b6-5c5e38a2940d/fdf8c519-eeb4-478b-a911-a54e313ce507-original 200w, /_ipx/rotate_null&w_400&f_webp/https://MY_BRANCH.DOMAIN//00a9b372-78d6-46ec-a3b6-5c5e38a2940d/fdf8c519-eeb4-478b-a911-a54e313ce507-original 400w"

But, when the same is deployed on dev and test, I see

srcset="https://MY_BRANCH.DOMAIN/00a9b372-78d6-46ec-a3b6-5c5e38a2940d/fdf8c519-eeb4-478b-a911-a54e313ce507-original 200w, /https://MY_BRANCH.DOMAIN//00a9b372-78d6-46ec-a3b6-5c5e38a2940d/fdf8c519-eeb4-478b-a911-a54e313ce507-original 400w

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论