From 76c08a29e8cdb434920607855fc095ab15d787bb Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Wed, 30 Jun 2021 13:01:21 +0200 Subject: [PATCH] Update paths in other places --- docs/api-reference/next.config.js/introduction.md | 4 ++-- docs/basic-features/typescript.md | 2 +- packages/next-plugin-storybook/preset.js | 2 +- packages/next/types/index.d.ts | 5 +++++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/api-reference/next.config.js/introduction.md b/docs/api-reference/next.config.js/introduction.md index 097da42d032d1..32c72c02321c3 100644 --- a/docs/api-reference/next.config.js/introduction.md +++ b/docs/api-reference/next.config.js/introduction.md @@ -26,7 +26,7 @@ module.exports = (phase, { defaultConfig }) => { } ``` -`phase` is the current context in which the configuration is loaded. You can see the [available phases](https://github.com/vercel/next.js/blob/canary/packages/next/next-server/lib/constants.ts#L1-L4). Phases can be imported from `next/constants`: +`phase` is the current context in which the configuration is loaded. You can see the [available phases](https://github.com/vercel/next.js/blob/canary/packages/next/shared/lib/constants.ts#L1-L4). Phases can be imported from `next/constants`: ```js const { PHASE_DEVELOPMENT_SERVER } = require('next/constants') @@ -44,7 +44,7 @@ module.exports = (phase, { defaultConfig }) => { } ``` -The commented lines are the place where you can put the configs allowed by `next.config.js`, which are [defined in this file](https://github.com/vercel/next.js/blob/canary/packages/next/next-server/server/config-shared.ts#L68). +The commented lines are the place where you can put the configs allowed by `next.config.js`, which are [defined in this file](https://github.com/vercel/next.js/blob/canary/packages/next/server/config-shared.ts#L68). However, none of the configs are required, and it's not necessary to understand what each config does. Instead, search for the features you need to enable or modify in this section and they will show you what to do. diff --git a/docs/basic-features/typescript.md b/docs/basic-features/typescript.md index 80949dd0b6f74..8eeab64ceafe5 100644 --- a/docs/basic-features/typescript.md +++ b/docs/basic-features/typescript.md @@ -152,7 +152,7 @@ The `next.config.js` file must be a JavaScript file as it does not get parsed by // @ts-check /** - * @type {import('next/dist/next-server/server/config').NextConfig} + * @type {import('next').NextConfig} **/ const nextConfig = { /* config options here */ diff --git a/packages/next-plugin-storybook/preset.js b/packages/next-plugin-storybook/preset.js index 9f737d3a29ce9..8a70445c8d134 100644 --- a/packages/next-plugin-storybook/preset.js +++ b/packages/next-plugin-storybook/preset.js @@ -1,6 +1,6 @@ const { PHASE_PRODUCTION_BUILD } = require('next/constants') const { findPagesDir } = require('next/dist/lib/find-pages-dir') -const loadConfig = require('next/dist/next-server/server/config').default +const loadConfig = require('next/dist/server/config').default const getWebpackConfig = require('next/dist/build/webpack-config').default const CWD = process.cwd() diff --git a/packages/next/types/index.d.ts b/packages/next/types/index.d.ts index 00f5909c514da..61c426e34d24a 100644 --- a/packages/next/types/index.d.ts +++ b/packages/next/types/index.d.ts @@ -23,6 +23,11 @@ import { // @ts-ignore This path is generated at build time and conflicts otherwise import next from '../dist/server/next' +// @ts-ignore This path is generated at build time and conflicts otherwise +import { NextConfig as NextConfigType } from '../dist/server/config' + +export type NextConfig = NextConfigType + // Extend the React types with missing properties declare module 'react' { // support