DEV Community

loading...

Discussion on: Creating a Jamstack blog [Part 1]

Collapse
sgolovine profile image
Sunny Golovine

I love NextJS but I would recommend using Gatsby for now. The main reason is it's image optimization. If you plan on hosting with Vercel, Vercel will optimize your images in NextJS. Unfortunately, NextJS image optimization does not work on other hosting providers like Netlify. So I always recommend Gatsby because of that.

Collapse
nownano profile image
Ren Author

Hi Sunny! Since NextJS 10.0.0, Image Optimization was added as a Basic Feature and works out of the box, regardless of hosting provider.

nextjs.org/docs/basic-features/ima...
nextjs.org/docs/api-reference/next...

Cheers!

Collapse
sgolovine profile image
Sunny Golovine

Not quite. If you look at the bottom of the loader section on this page. nextjs.org/docs/basic-features/ima..., you will see:

The next/image component's default loader is not supported when using next export. However, other loader options will work.

Enter fullscreen mode Exit fullscreen mode
Thread Thread
nownano profile image
Ren Author

You're correct, when it comes to SSG outside of Vercel, a custom loader or additional plugin is needed.

Lee Robinson goes into more detail here:
github.com/vercel/next.js/discussi...

He provides two alternative solutions for SSG image optimization.
Implementing a custom loader (I also recommend Cloudinary).
Or implementing "next-optimized-images", which would be no different than Gatsby's implementation of three plugins to achieve the same goal.

Forem Open with the Forem app