This is a full rewrite of the Essential Next.js plugin, with a new architecture that gives greater compatibility and stability.
- Full support for Next.js rewrites, redirects and headers.
- Removes requirement for the
target
to be set toserverless
, which is deprecated in Next 12. - Faster builds and deploys. Instead of generating one function per route, there are just three functions per site and a much smaller list of rewrites.
- Bundling now uses Next.js's own node-file-trace, giving more predictable results and smaller uploads.
- Full support for Netlify's new persistent On-Demand Builders. Return
fallback: "blocking"
fromgetStaticPaths
and your rendering will be deferred until the first page load, then persisted globally. - A new image server, built on Nuxt's ipx. This is a high-performance, framework-agnostic image server based on sharp. This implementation uses On-Demand Builders to persist transformed images globally. Improved source image caching reduces time-to-first-byte for new transforms.
- Simplified configuration. You no longer need to set any Netlify-specific configuration options. For example, in a monorepo all you need to do is set
publish
to point to your.next
directory and you can build the site in any way you like.
If you would like to try the beta, you should install it manually like this:
- Install the module:
npm install -D @netlify/plugin-nextjs@beta
- Change the
publish
directory to.next
and add the plugin tonetlify.toml
if not already installed:
[build]
publish = ".next"
[[plugins]]
package = "@netlify/plugin-nextjs"