0

We are generating Next.js SSG site from Strapi content and extensively use media field types in Strapi content types.

When using next/image component we get following html in our build:

... <img .. src="https://site-domain.com/_next/image/?url=https://strapi-internal.com/uploads/prepare_In_Few_Click_5f78e2b71e.svg&w=640&q=75" ... /> ...

We want to somehow continue using media field types in Strapi, instead of inlining URLs and copying appropriate images separately to next.js project, but at the same time I don't want to expose Strapi internal URL in the browser.

We experimented with image component loaders, but it seems that it's not doable. Do you have any ideas how this can be achieved?

instead of this:

https://site-domain.com/_next/image/?url=**https://strapi-internal.com/uploads/prepare_In_Few_Click_5f78e2b71e.svg**&w=640&q=75

I want to achieve something like this and hence avoid need to expose https://strapi-internal.com this URL:

https://site-domain.com/_next/image/?url=**/prepare_In_Few_Click_5f78e2b71e.svg**&w=640&q=75

We tried all documented props of image component and searched the web for solutions but didn't find anything appealing.

0 Answers0