Unverified Commit 3b978692 authored by Steven's avatar Steven Committed by GitHub

Add jsdoc types to docs snippets (#27125)

This PR adds the JSDoc types so that VS Code and other tools can use autocompletion when editing `next.config.js`
parent f52955ec
...@@ -11,18 +11,27 @@ For custom advanced behavior of Next.js, you can create a `next.config.js` in th ...@@ -11,18 +11,27 @@ For custom advanced behavior of Next.js, you can create a `next.config.js` in th
Take a look at the following `next.config.js` example: Take a look at the following `next.config.js` example:
```js ```js
module.exports = { /**
* @type {import('next').NextConfig}
*/
const nextConfig = {
/* config options here */ /* config options here */
} }
module.exports = nextConfig
``` ```
You can also use a function: You can also use a function:
```js ```js
module.exports = (phase, { defaultConfig }) => { module.exports = (phase, { defaultConfig }) => {
return { /**
* @type {import('next').NextConfig}
*/
const nextConfig = {
/* config options here */ /* config options here */
} }
return nextConfig
} }
``` ```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment