Company
Date Published
Author
Cassidy Williams
Word count
492
Language
English
Hacker News points
None

Summary

Preview Mode for Next.js now fully supported on Netlify allows users to bypass statically generated pages and server-side render draft pages from any data fetching solution, enabling them to see a preview of what their content will look like before committing changes. This feature is ideal for CMS solutions where teams want to view the effects of their changes before running a full build of their website. With the introduction of `next-on-netlify`, users can easily install and configure Preview Mode in their Next.js projects, which wraps the application in a compatibility layer that allows pages to use Netlify Functions for server-side rendering. The package is easy to install, requiring only four steps: installing the npm module, adding a postbuild hook to the `package.json` file, setting the target to "serverless" in `next.config.js`, and updating the `netlify.toml` file to tell Netlify how to build the Next.js app. The feature is now fully supported on Netlify, allowing users to take advantage of it today.