[Docs] Add config types to all examples (#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)
This commit is contained in:
parent
e7e567b1fc
commit
92aafcbcf1
70 changed files with 71 additions and 5 deletions
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
async rewrites() {
|
||||
return [
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
const withBundleAnalyzer = require('@next/bundle-analyzer')({
|
||||
enabled: process.env.ANALYZE === 'true',
|
||||
})
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
// any configs you need
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: ['./components/**/*.tsx', './pages/**/*.tsx'],
|
||||
theme: {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
mode: 'jit',
|
||||
purge: ['./pages/**/*.js', './components/**/*.js'],
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
const withNextra = require('nextra')({
|
||||
theme: 'nextra-theme-blog',
|
||||
themeConfig: './theme.config.js',
|
||||
// optional: add `unstable_staticImage: true` to enable Nextra's auto image import
|
||||
})
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
// any configs you need
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: [
|
||||
'./pages/**/*.{js,ts,jsx,tsx}',
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
images: {
|
||||
domains: ['cdn.builder.io'],
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: ['./components/**/*.js', './pages/**/*.js'],
|
||||
theme: {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
reactStrictMode: true,
|
||||
async rewrites() {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
images: {
|
||||
loader: 'custom',
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: [
|
||||
'./pages/**/*.{js,ts,jsx,tsx}',
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
images: {
|
||||
domains: ['imgix.cosmicjs.com'],
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: [
|
||||
'./pages/**/*.{js,ts,jsx,tsx}',
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
images: {
|
||||
domains: ['www.datocms-assets.com'],
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: [
|
||||
'./pages/**/*.{js,ts,jsx,tsx}',
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
images: {
|
||||
domains: [process.env.NEXT_IMAGE_DOMAIN],
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: [
|
||||
'./pages/**/*.{js,ts,jsx,tsx}',
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
images: {
|
||||
domains: ['static.ghost.org'],
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: [
|
||||
'./pages/**/*.{js,ts,jsx,tsx}',
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
images: {
|
||||
domains: ['media.graphcms.com'],
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: [
|
||||
'./pages/**/*.{js,ts,jsx,tsx}',
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: [
|
||||
'./pages/**/*.{js,ts,jsx,tsx}',
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
images: {
|
||||
domains: ['b-cdn.net'],
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: [
|
||||
'./pages/**/*.{js,ts,jsx,tsx}',
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
images: {
|
||||
domains: ['images.prismic.io'],
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: [
|
||||
'./pages/**/*.{js,ts,jsx,tsx}',
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
experimental: {
|
||||
images: {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: [
|
||||
'./pages/**/*.{js,ts,jsx,tsx}',
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: [
|
||||
'./pages/**/*.{js,ts,jsx,tsx}',
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
images: {
|
||||
domains: ['localhost'],
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: [
|
||||
'./pages/**/*.{js,ts,jsx,tsx}',
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: [
|
||||
'./pages/**/*.{js,ts,jsx,tsx}',
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: ['./components/**/*.js', './pages/**/*.js'],
|
||||
theme: {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
images: {
|
||||
domains: ['media.umbraco.io'],
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: [
|
||||
'./pages/**/*.{js,ts,jsx,tsx}',
|
||||
|
|
|
@ -5,6 +5,7 @@ if (!process.env.WORDPRESS_API_URL) {
|
|||
`)
|
||||
}
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
images: {
|
||||
domains: [
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: [
|
||||
'./pages/**/*.{js,ts,jsx,tsx}',
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
basePath: '/gh-pages-test',
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
async headers() {
|
||||
return [
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
i18n: {
|
||||
locales: ['en', 'fr', 'nl'],
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
images: {
|
||||
domains: ['assets.vercel.com'],
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
experimental: {
|
||||
modularizeImports: {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
experimental: {
|
||||
reactRemoveProperties: true,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
// Uncomment the line below to enable basePath, pages and
|
||||
// redirects will then have a path prefix (`/app` in this case)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
experimental: {
|
||||
removeConsole: {
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/** @type {import("next").NextConfig} */
|
||||
const config = {
|
||||
module.exports = {
|
||||
reactStrictMode: true,
|
||||
}
|
||||
|
||||
module.exports = config
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
async rewrites() {
|
||||
return [
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
webpack: (config) => {
|
||||
config.module.rules.push({
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
output: 'standalone',
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
output: 'standalone',
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
distDir: '../.next',
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
/* this needs to be set to false until a bug in the compression npm module gets fixed.
|
||||
reference: https://github.com/expressjs/compression/issues/122
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
i18n: {
|
||||
locales: ['en', 'de'],
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
const path = require('path')
|
||||
const CopyPlugin = require('copy-webpack-plugin')
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
webpack: (config) => {
|
||||
config.plugins.push(
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
const { locales, sourceLocale } = require('./lingui.config.js')
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
i18n: {
|
||||
locales,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
reactStrictMode: true,
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: [
|
||||
'./pages/**/*.{js,ts,jsx,tsx}',
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
webpack: (configuration) => {
|
||||
configuration.module.rules.push({
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
webpack: (config) => {
|
||||
config.resolve.alias = {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
mode: 'jit',
|
||||
purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'],
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
webpack: (config, { isServer }) => {
|
||||
if (isServer) {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
reactStrictMode: true,
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
webpack: function (config) {
|
||||
config.externals = config.externals || {}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
const colors = require('tailwindcss/colors')
|
||||
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'],
|
||||
darkMode: 'class',
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
webpack(config, options) {
|
||||
config.module.rules.push({
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
mode: 'jit',
|
||||
purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'],
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
webpack(config) {
|
||||
config.output.webassemblyModuleFilename = 'static/wasm/[modulehash].wasm'
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
const path = require('path')
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
webpack(config, { dev, isServer }) {
|
||||
if (dev && !isServer) {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
basePath: '/blog',
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
const { BLOG_URL } = process.env
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
module.exports = {
|
||||
async rewrites() {
|
||||
return [
|
||||
|
|
Loading…
Reference in a new issue