Caravaggio can be integrated with NextJS to easily tranform images contained in your project
and external images. By using Caravaggio you're able to apply all Caravaggio transformations and to create
cached version of these images. Differently from other image resize plugins, Caravaggio doesn't affect
your build process delegating the production of cached images on the first request. If you want an in-depth
explanation and details about this tecnique, read the article
NextJS + Caravaggio, serve images like a rockstar!.
Here a quick explanation of the integration steps, but read the article for a more complete description.
In your NextJS project install these dependencies
Create an api page
and put this content
.ts), use the CaravaggioProvider
That's all. You can now use components from
caravaggio-react to use all Caravaggio transformations