diff --git a/README.md b/README.md index 10d4189b48..7be0dda210 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,6 @@ -![Next.js on Netlify Build Plugin](next-on-netlify.png) +![Essential Next.js Build Plugin](next-on-netlify.png) -# Essential Next.js Build Plugin (beta) - -:warning: This is the beta version of the Essential Next.js plugin. For the stable version, refer to -[Essential Next.js plugin v3](https://github.com/netlify/netlify-plugin-nextjs/tree/v3#readme) :warning: +# Essential Next.js Build Plugin

@@ -19,36 +16,46 @@ Version 4 is a complete rewrite of the Essential Next.js plugin. For full details of everything that's new, check out [the v4 release notes](https://github.com/netlify/netlify-plugin-nextjs/blob/main/docs/release-notes/v4.md) -## Installing the beta +## Installing the plugin -- Install the module: +The plugin installs automatically for new Next.js sites on Netlify. You can also install it manually like this: ```shell -npm install -D @netlify/plugin-nextjs@beta +npm install -D @netlify/plugin-nextjs ``` -- Change the `publish` directory to `.next` and add the plugin to `netlify.toml` if not already installed: +...then add the plugin to your `netlify.toml` file: ```toml -[build] -publish = ".next" - [[plugins]] package = "@netlify/plugin-nextjs" ``` -If you previously set a custom `distDir` in your `next.config.js`, or set `node_bundler` or `external_node_modules` in -your `netlify.toml` these are no longer needed and can be removed. +## Migrating from an older version of the plugin + +You can manually upgrade from the previous version of the plugin by running the following command: + +```shell +npm install -D @netlify/plugin-nextjs@latest +``` + +Change the `publish` directory to `.next`: + +```toml +[build] +publish = ".next" +``` + +If you previously set these values, they're no longer needed and can be removed: + +- `distDir` in your `next.config.js` +- `node_bundler = "esbuild"` in `netlify.toml` +- `external_node_modules` in `netlify.toml` The `serverless` and `experimental-serverless-trace` targets are deprecated in Next 12, and all builds with this plugin will now use the default `server` target. If you previously set the target in your `next.config.js`, you should remove it. -If you are using a monorepo you will need to change `publish` to point to the full path to the built `.next` directory, -which may be in a subdirectory. If you have changed your `distDir` then it will need to match that. - -If you are using Nx, then you will need to point `publish` to the folder inside `dist`, e.g. `dist/apps/myapp/.next`. - If you currently use redirects or rewrites on your site, see [the Rewrites and Redirects guide](https://github.com/netlify/netlify-plugin-nextjs/blob/main/docs/redirects-rewrites.md) for information on changes to how they are handled in this version. @@ -57,7 +64,20 @@ If you want to use Next 12's beta Middleware feature, this will mostly work as e [read the docs on some caveats and workarounds](https://github.com/netlify/netlify-plugin-nextjs/blob/main/docs/middleware.md) that are currently needed. -## Beta feedback +## Monorepos + +If you are using a monorepo you will need to change `publish` to point to the full path to the built `.next` directory, +which may be in a subdirectory. If you have changed your `distDir` then it will need to match that. + +If you are using Nx, then you will need to point `publish` to the folder inside `dist`, e.g. `dist/apps/myapp/.next`. + +## Incremental Static Regeneration (ISR) + +The Essential Next.js plugin now fully supports ISR on Netlify. For more details see +[the ISR docs](https://github.com/netlify/netlify-plugin-nextjs/blob/main/docs/isr.md). + +## Feedback -Please share any thoughts, feedback or questions about the beta -[in our discussion](https://github.com/netlify/netlify-plugin-nextjs/discussions/706). +If you think you have found a bug in the plugin, +[please open an issue](https://github.com/netlify/netlify-plugin-nextjs/issues). If you have comments or feature +requests, [see the dicussion board](https://github.com/netlify/netlify-plugin-nextjs/discussions) diff --git a/src/helpers/verification.ts b/src/helpers/verification.ts index afcd736d3d..f7b87a170e 100644 --- a/src/helpers/verification.ts +++ b/src/helpers/verification.ts @@ -136,13 +136,3 @@ export const checkZipSize = async (file: string, maxSize: number = LAMBDA_MAX_SI greenBright`\n\nFor more information on fixing this, see ${blueBright`https://ntl.fyi/large-next-functions`}`, ) } - -export const logBetaMessage = () => - console.log( - greenBright( - outdent` - Thank you for trying the Essential Next.js beta plugin. - Please share feedback (both good and bad) at ${blueBright`https://ntl.fyi/next-beta-feedback`} - `, - ), - ) diff --git a/src/index.ts b/src/index.ts index 70d90305dd..616a0b24c3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,7 +12,6 @@ import { verifyNetlifyBuildVersion, checkNextSiteHasBuilt, checkForRootPublish, - logBetaMessage, checkZipSize, checkForOldFunctions, } from './helpers/verification' @@ -26,7 +25,6 @@ const plugin: NetlifyPlugin = { cache, }, }) { - logBetaMessage() const { publish } = netlifyConfig.build checkForRootPublish({ publish, failBuild }) verifyNetlifyBuildVersion({ failBuild, ...constants }) @@ -98,8 +96,5 @@ const plugin: NetlifyPlugin = { const { basePath } = await getNextConfig({ publish: netlifyConfig.build.publish, failBuild }) await unpatchNextFiles(basePath) }, - onEnd() { - logBetaMessage() - }, } module.exports = plugin