Skip to content

Commit 92aafcb

Browse files
authored
[Docs] Add config types to all examples (vercel#40083)
<!-- Thanks for opening a PR! Your contribution is much appreciated. In order to make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change that you're making: --> ## Summary - Added jsdoc typing for all examples using `next.config.js` - Added jsdoc typing for all examples using `tailwind.config.js` ## Documentation / Examples - [x] Make sure the linting passes by running `pnpm lint` - [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
1 parent e7e567b commit 92aafcb

File tree

70 files changed

+71
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+71
-5
lines changed

examples/active-class-name/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
async rewrites() {
34
return [

examples/analyze-bundles/next.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
/** @type {import('next').NextConfig} */
21
const withBundleAnalyzer = require('@next/bundle-analyzer')({
32
enabled: process.env.ANALYZE === 'true',
43
})
54

5+
/** @type {import('next').NextConfig} */
66
const nextConfig = {
77
// any configs you need
88
}

examples/blog-starter/tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('tailwindcss').Config} */
12
module.exports = {
23
content: ['./components/**/*.tsx', './pages/**/*.tsx'],
34
theme: {

examples/blog-with-comment/tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('tailwindcss').Config} */
12
module.exports = {
23
mode: 'jit',
34
purge: ['./pages/**/*.js', './components/**/*.js'],

examples/blog/next.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
/** @type {import('next').NextConfig} */
21
const withNextra = require('nextra')({
32
theme: 'nextra-theme-blog',
43
themeConfig: './theme.config.js',
54
// optional: add `unstable_staticImage: true` to enable Nextra's auto image import
65
})
76

7+
/** @type {import('next').NextConfig} */
88
const nextConfig = {
99
// any configs you need
1010
}

examples/cms-agilitycms/tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('tailwindcss').Config} */
12
module.exports = {
23
content: [
34
'./pages/**/*.{js,ts,jsx,tsx}',

examples/cms-builder-io/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
images: {
34
domains: ['cdn.builder.io'],

examples/cms-builder-io/tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('tailwindcss').Config} */
12
module.exports = {
23
content: ['./components/**/*.js', './pages/**/*.js'],
34
theme: {

examples/cms-buttercms/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
reactStrictMode: true,
34
async rewrites() {

examples/cms-contentful/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
images: {
34
loader: 'custom',

examples/cms-contentful/tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('tailwindcss').Config} */
12
module.exports = {
23
content: [
34
'./pages/**/*.{js,ts,jsx,tsx}',

examples/cms-cosmic/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
images: {
34
domains: ['imgix.cosmicjs.com'],

examples/cms-cosmic/tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('tailwindcss').Config} */
12
module.exports = {
23
content: [
34
'./pages/**/*.{js,ts,jsx,tsx}',

examples/cms-datocms/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
images: {
34
domains: ['www.datocms-assets.com'],

examples/cms-datocms/tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('tailwindcss').Config} */
12
module.exports = {
23
content: [
34
'./pages/**/*.{js,ts,jsx,tsx}',

examples/cms-drupal/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
images: {
34
domains: [process.env.NEXT_IMAGE_DOMAIN],

examples/cms-drupal/tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('tailwindcss').Config} */
12
module.exports = {
23
content: [
34
'./pages/**/*.{js,ts,jsx,tsx}',

examples/cms-ghost/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
images: {
34
domains: ['static.ghost.org'],

examples/cms-ghost/tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('tailwindcss').Config} */
12
module.exports = {
23
content: [
34
'./pages/**/*.{js,ts,jsx,tsx}',

examples/cms-graphcms/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
images: {
34
domains: ['media.graphcms.com'],

examples/cms-graphcms/tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('tailwindcss').Config} */
12
module.exports = {
23
content: [
34
'./pages/**/*.{js,ts,jsx,tsx}',

examples/cms-kontent/tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('tailwindcss').Config} */
12
module.exports = {
23
content: [
34
'./pages/**/*.{js,ts,jsx,tsx}',

examples/cms-prepr/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
images: {
34
domains: ['b-cdn.net'],

examples/cms-prepr/tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('tailwindcss').Config} */
12
module.exports = {
23
content: [
34
'./pages/**/*.{js,ts,jsx,tsx}',

examples/cms-prismic/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
images: {
34
domains: ['images.prismic.io'],

examples/cms-prismic/tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('tailwindcss').Config} */
12
module.exports = {
23
content: [
34
'./pages/**/*.{js,ts,jsx,tsx}',

examples/cms-sanity/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
experimental: {
34
images: {

examples/cms-sanity/tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('tailwindcss').Config} */
12
module.exports = {
23
content: [
34
'./pages/**/*.{js,ts,jsx,tsx}',

examples/cms-storyblok/tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('tailwindcss').Config} */
12
module.exports = {
23
content: [
34
'./pages/**/*.{js,ts,jsx,tsx}',

examples/cms-strapi/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
images: {
34
domains: ['localhost'],

examples/cms-strapi/tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('tailwindcss').Config} */
12
module.exports = {
23
content: [
34
'./pages/**/*.{js,ts,jsx,tsx}',

examples/cms-takeshape/tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('tailwindcss').Config} */
12
module.exports = {
23
content: [
34
'./pages/**/*.{js,ts,jsx,tsx}',

examples/cms-tina/tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('tailwindcss').Config} */
12
module.exports = {
23
content: ['./components/**/*.js', './pages/**/*.js'],
34
theme: {

examples/cms-umbraco-heartcore/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
images: {
34
domains: ['media.umbraco.io'],

examples/cms-umbraco-heartcore/tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('tailwindcss').Config} */
12
module.exports = {
23
content: [
34
'./pages/**/*.{js,ts,jsx,tsx}',

examples/cms-wordpress/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ if (!process.env.WORDPRESS_API_URL) {
55
`)
66
}
77

8+
/** @type {import('next').NextConfig} */
89
module.exports = {
910
images: {
1011
domains: [

examples/cms-wordpress/tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('tailwindcss').Config} */
12
module.exports = {
23
content: [
34
'./pages/**/*.{js,ts,jsx,tsx}',

examples/github-pages/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
basePath: '/gh-pages-test',
34
}

examples/headers/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
async headers() {
34
return [

examples/i18n-routing/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
i18n: {
34
locales: ['en', 'fr', 'nl'],

examples/image-component/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
images: {
34
domains: ['assets.vercel.com'],

examples/modularize-imports/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
experimental: {
34
modularizeImports: {

examples/react-remove-properties/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
experimental: {
34
reactRemoveProperties: true,

examples/redirects/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
// Uncomment the line below to enable basePath, pages and
34
// redirects will then have a path prefix (`/app` in this case)

examples/remove-console/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
experimental: {
34
removeConsole: {
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
/** @type {import("next").NextConfig} */
2-
const config = {
2+
module.exports = {
33
reactStrictMode: true,
44
}
5-
6-
module.exports = config

examples/rewrites/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
async rewrites() {
34
return [

examples/with-compiled-css/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
webpack: (config) => {
34
config.module.rules.push({
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
output: 'standalone',
34
}

examples/with-docker/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
output: 'standalone',
34
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
distDir: '../.next',
34
}

examples/with-http2/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
/* this needs to be set to false until a bug in the compression npm module gets fixed.
34
reference: https://github.com/expressjs/compression/issues/122

examples/with-i18n-next-intl/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
i18n: {
34
locales: ['en', 'de'],

examples/with-ionic-typescript/next.config.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
const path = require('path')
22
const CopyPlugin = require('copy-webpack-plugin')
3+
4+
/** @type {import('next').NextConfig} */
35
module.exports = {
46
webpack: (config) => {
57
config.plugins.push(

examples/with-lingui/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const { locales, sourceLocale } = require('./lingui.config.js')
22

3+
/** @type {import('next').NextConfig} */
34
module.exports = {
45
i18n: {
56
locales,

examples/with-mysql/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
reactStrictMode: true,
34
}

examples/with-mysql/tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('tailwindcss').Config} */
12
module.exports = {
23
content: [
34
'./pages/**/*.{js,ts,jsx,tsx}',

examples/with-netlify-cms/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
webpack: (configuration) => {
34
configuration.module.rules.push({

examples/with-react-native-web/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
webpack: (config) => {
34
config.resolve.alias = {

examples/with-redis/tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('tailwindcss').Config} */
12
module.exports = {
23
mode: 'jit',
34
purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'],

examples/with-sitemap/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
webpack: (config, { isServer }) => {
34
if (isServer) {
+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
reactStrictMode: true,
34
}

examples/with-styletron/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
webpack: function (config) {
34
config.externals = config.externals || {}

examples/with-tailwindcss-emotion/tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const colors = require('tailwindcss/colors')
22

3+
/** @type {import('tailwindcss').Config} */
34
module.exports = {
45
purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'],
56
darkMode: 'class',

examples/with-typescript-graphql/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
webpack(config, options) {
34
config.module.rules.push({

examples/with-userbase/tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('tailwindcss').Config} */
12
module.exports = {
23
mode: 'jit',
34
purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'],

examples/with-webassembly/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
webpack(config) {
34
config.output.webassemblyModuleFilename = 'static/wasm/[modulehash].wasm'

examples/with-why-did-you-render/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const path = require('path')
22

3+
/** @type {import('next').NextConfig} */
34
module.exports = {
45
webpack(config, { dev, isServer }) {
56
if (dev && !isServer) {
+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('next').NextConfig} */
12
module.exports = {
23
basePath: '/blog',
34
}

examples/with-zones/home/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const { BLOG_URL } = process.env
22

3+
/** @type {import('next').NextConfig} */
34
module.exports = {
45
async rewrites() {
56
return [

0 commit comments

Comments
 (0)