diff --git a/examples/redirects/README.md b/examples/redirects/README.md index 06d7a102d8d23..3d1406a13e25b 100644 --- a/examples/redirects/README.md +++ b/examples/redirects/README.md @@ -1,6 +1,6 @@ # Redirects Example -This example shows how to use [redirects in Next.js](https://nextjs.org/docs/api-reference/next.config.js/redirects) to redirect an incoming request path to a different destination path. +This example shows how to use [redirects in Next.js](https://nextjs.org/docs/app/api-reference/config/next-config-js/redirects) to redirect an incoming request path to a different destination path. The index page ([`app/page.tsx`](app/page.tsx)) has a list of links that match the redirects defined in [`next.config.js`](next.config.js). Run or deploy the app to see how it works! diff --git a/examples/redirects/app/page.tsx b/examples/redirects/app/page.tsx index 4138f2d2fb741..97997a0fd1592 100644 --- a/examples/redirects/app/page.tsx +++ b/examples/redirects/app/page.tsx @@ -11,7 +11,7 @@ export default function Home() {

The links below are custom <> diff --git a/examples/with-sentry/next.config.js b/examples/with-sentry/next.config.js index 2f457359f2165..b0a9dbab1daf4 100644 --- a/examples/with-sentry/next.config.js +++ b/examples/with-sentry/next.config.js @@ -1,6 +1,6 @@ // This file sets a custom webpack configuration to use your Next.js app // with Sentry. -// https://nextjs.org/docs/api-reference/next.config.js/introduction +// https://nextjs.org/docs/app/api-reference/config/next-config-js // https://docs.sentry.io/platforms/javascript/guides/nextjs/ const { withSentryConfig } = require("@sentry/nextjs"); diff --git a/examples/with-zones/README.md b/examples/with-zones/README.md index a30b2b8c0cf92..2573dfb084409 100644 --- a/examples/with-zones/README.md +++ b/examples/with-zones/README.md @@ -11,7 +11,7 @@ Multi-Zone applications work by having one of the applications route requests fo - The `home` app is the main app and therefore it includes the rewrites that map to the `blog` app in [next.config.js](home/next.config.js) - `home` will serve all paths that are not specifically routed to `blog`. - `blog` will serve the `/blog` and `/blog/*` paths. -- The `blog` app sets [`basePath`](https://nextjs.org/docs/api-reference/next.config.js/basepath) to `/blog` so that generated pages, Next.js assets and public assets are unique to the `blog` zone and won't conflict with anything from the other zones. +- The `blog` app sets [`basePath`](https://nextjs.org/docs/app/api-reference/config/next-config-js/basePath) to `/blog` so that generated pages, Next.js assets and public assets are unique to the `blog` zone and won't conflict with anything from the other zones. NOTE: A `basePath` will prefix all pages in the application with the `basePath` automatically, including relative links. If you have many pages that don't share the same path prefix (for example, `/home` and `/blog` live in the same zone), you can use [`assetPrefix`](https://nextjs.org/docs/app/api-reference/config/next-config-js/assetPrefix) to add a unique prefix for Next.js assets without affecting the other pages. diff --git a/packages/next/src/server/config-shared.ts b/packages/next/src/server/config-shared.ts index cc9f90351a73f..62ca29ec34c32 100644 --- a/packages/next/src/server/config-shared.ts +++ b/packages/next/src/server/config-shared.ts @@ -635,7 +635,7 @@ export type ExportPathMap = { * * This can change the behavior, enable experimental features, and configure other advanced options. * - * Read more: [Next.js Docs: `next.config.js`](https://nextjs.org/docs/api-reference/next.config.js/introduction) + * Read more: [Next.js Docs: `next.config.js`](https://nextjs.org/docs/app/api-reference/config/next-config-js) */ export interface NextConfig extends Record { exportPathMap?: ( @@ -670,14 +670,14 @@ export interface NextConfig extends Record { /** * Headers allow you to set custom HTTP headers for an incoming request path. * - * @see [Headers configuration documentation](https://nextjs.org/docs/api-reference/next.config.js/headers) + * @see [Headers configuration documentation](https://nextjs.org/docs/app/api-reference/config/next-config-js/headers) */ headers?: () => Promise /** * Rewrites allow you to map an incoming request path to a different destination path. * - * @see [Rewrites configuration documentation](https://nextjs.org/docs/api-reference/next.config.js/rewrites) + * @see [Rewrites configuration documentation](https://nextjs.org/docs/app/api-reference/config/next-config-js/rewrites) */ rewrites?: () => Promise< | Rewrite[] @@ -691,7 +691,7 @@ export interface NextConfig extends Record { /** * Redirects allow you to redirect an incoming request path to a different destination path. * - * @see [Redirects configuration documentation](https://nextjs.org/docs/api-reference/next.config.js/redirects) + * @see [Redirects configuration documentation](https://nextjs.org/docs/app/api-reference/config/next-config-js/redirects) */ redirects?: () => Promise @@ -703,7 +703,7 @@ export interface NextConfig extends Record { /** * Before continuing to add custom webpack configuration to your application make sure Next.js doesn't already support your use-case * - * @see [Custom Webpack Config documentation](https://nextjs.org/docs/api-reference/next.config.js/custom-webpack-config) + * @see [Custom Webpack Config documentation](https://nextjs.org/docs/app/api-reference/config/next-config-js/webpack) */ webpack?: NextJsWebpackConfig | null @@ -711,14 +711,14 @@ export interface NextConfig extends Record { * By default Next.js will redirect urls with trailing slashes to their counterpart without a trailing slash. * * @default false - * @see [Trailing Slash Configuration](https://nextjs.org/docs/api-reference/next.config.js/trailing-slash) + * @see [Trailing Slash Configuration](https://nextjs.org/docs/app/api-reference/config/next-config-js/trailingSlash) */ trailingSlash?: boolean /** * Next.js comes with built-in support for environment variables * - * @see [Environment Variables documentation](https://nextjs.org/docs/api-reference/next.config.js/environment-variables) + * @see [Environment Variables documentation](https://nextjs.org/docs/app/api-reference/config/next-config-js/env) */ env?: Record @@ -735,7 +735,7 @@ export interface NextConfig extends Record { /** * To set up a CDN, you can set up an asset prefix and configure your CDN's origin to resolve to the domain that Next.js is hosted on. * - * @see [CDN Support with Asset Prefix](https://nextjs.org/docs/api-reference/next.config.js/cdn-support-with-asset-prefix) + * @see [CDN Support with Asset Prefix](https://nextjs.org/docs/app/api-reference/config/next-config-js/assetPrefix) */ assetPrefix?: string @@ -764,20 +764,20 @@ export interface NextConfig extends Record { useFileSystemPublicRoutes?: boolean /** - * @see [Configuring the build ID](https://nextjs.org/docs/api-reference/next.config.js/configuring-the-build-id) + * @see [Configuring the build ID](https://nextjs.org/docs/app/api-reference/config/next-config-js/generateBuildId) */ generateBuildId?: () => string | null | Promise - /** @see [Disabling ETag Configuration](https://nextjs.org/docs/api-reference/next.config.js/disabling-etag-generation) */ + /** @see [Disabling ETag Configuration](https://nextjs.org/docs/app/api-reference/config/next-config-js/generateEtags) */ generateEtags?: boolean - /** @see [Including non-page files in the pages directory](https://nextjs.org/docs/api-reference/next.config.js/custom-page-extensions) */ + /** @see [Including non-page files in the pages directory](https://nextjs.org/docs/app/api-reference/config/next-config-js/pageExtensions) */ pageExtensions?: string[] - /** @see [Compression documentation](https://nextjs.org/docs/api-reference/next.config.js/compression) */ + /** @see [Compression documentation](https://nextjs.org/docs/app/api-reference/config/next-config-js/compress) */ compress?: boolean - /** @see [Disabling x-powered-by](https://nextjs.org/docs/api-reference/next.config.js/disabling-x-powered-by) */ + /** @see [Disabling x-powered-by](https://nextjs.org/docs/app/api-reference/config/next-config-js/poweredByHeader) */ poweredByHeader?: boolean /** @see [Using the Image Component](https://nextjs.org/docs/app/api-reference/next-config-js/images) */ @@ -800,7 +800,7 @@ export interface NextConfig extends Record { /** * Next.js exposes some options that give you some control over how the server will dispose or keep in memory built pages in development. * - * @see [Configuring `onDemandEntries`](https://nextjs.org/docs/api-reference/next.config.js/configuring-onDemandEntries) + * @see [Configuring `onDemandEntries`](https://nextjs.org/docs/app/api-reference/config/next-config-js/onDemandEntries) */ onDemandEntries?: { /** period (in ms) where the server will keep pages in the buffer */ @@ -822,7 +822,7 @@ export interface NextConfig extends Record { /** * Deploy a Next.js application under a sub-path of a domain * - * @see [Base path configuration](https://nextjs.org/docs/api-reference/next.config.js/basepath) + * @see [Base path configuration](https://nextjs.org/docs/app/api-reference/config/next-config-js/basePath) */ basePath?: string @@ -848,7 +848,7 @@ export interface NextConfig extends Record { /** * The Next.js runtime is Strict Mode-compliant. * - * @see [React Strict Mode](https://nextjs.org/docs/api-reference/next.config.js/react-strict-mode) + * @see [React Strict Mode](https://nextjs.org/docs/app/api-reference/config/next-config-js/reactStrictMode) */ reactStrictMode?: boolean | null @@ -856,21 +856,21 @@ export interface NextConfig extends Record { * The maximum length of the headers that are emitted by React and added to * the response. * - * @see [React Max Headers Length](https://nextjs.org/docs/api-reference/next.config.js/react-max-headers-length) + * @see [React Max Headers Length](https://nextjs.org/docs/app/api-reference/config/next-config-js/reactMaxHeadersLength) */ reactMaxHeadersLength?: number /** * Add public (in browser) runtime configuration to your app * - * @see [Runtime configuration](https://nextjs.org/docs/api-reference/next.config.js/runtime-configuration) + * @see [Runtime configuration](https://nextjs.org/docs/pages/api-reference/config/next-config-js/runtime-configuration */ publicRuntimeConfig?: { [key: string]: any } /** * Add server runtime configuration to your app * - * @see [Runtime configuration](https://nextjs.org/docs/api-reference/next.config.js/runtime-configuration) + * @see [Runtime configuration](https://nextjs.org/docs/pages/api-reference/config/next-config-js/runtime-configuration */ serverRuntimeConfig?: { [key: string]: any }