docs: add missing configuration documentation to nuxt 3 docs (#4020)

This commit is contained in:
Daniel Roe 2022-04-01 14:02:26 +01:00 committed by GitHub
parent 91576c9892
commit 1890c55cbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 47 additions and 31 deletions

View File

@ -3,7 +3,11 @@ import { existsSync, readdirSync } from 'fs'
import defu from 'defu' import defu from 'defu'
export default { export default {
/** Vue.js config */ /**
* Vue.js config
* @version 2
* @version 3
*/
vue: { vue: {
/** /**
* Properties that will be set directly on `Vue.config` for vue@2. * Properties that will be set directly on `Vue.config` for vue@2.

View File

@ -8,6 +8,7 @@ export default {
* The builder to use for bundling the Vue part of your application. * The builder to use for bundling the Vue part of your application.
* *
* @type {'vite' | 'webpack' | { bundle: (nuxt: typeof import('../src/types/nuxt').Nuxt) => Promise<void> }} * @type {'vite' | 'webpack' | { bundle: (nuxt: typeof import('../src/types/nuxt').Nuxt) => Promise<void> }}
* @version 3
*/ */
builder: { builder: {
$resolve: (val, get) => { $resolve: (val, get) => {
@ -21,17 +22,21 @@ export default {
return map[val] || (get('vite') === false ? map.webpack : map.vite) return map[val] || (get('vite') === false ? map.webpack : map.vite)
}, },
}, },
/**
build: { * Shared build configuration.
/**
* Suppresses most of the build output log.
*
* It is enabled by default when a CI or test environment is detected.
*
* @see [std-env](https://github.com/unjs/std-env)
* @version 2 * @version 2
* @version 3 * @version 3
*/ */
build: {
/**
* Suppresses most of the build output log.
*
* It is enabled by default when a CI or test environment is detected.
*
* @see [std-env](https://github.com/unjs/std-env)
* @version 2
* @version 3
*/
quiet: Boolean(isCI || isTest), quiet: Boolean(isCI || isTest),
/** /**

View File

@ -1,22 +1,22 @@
export default { export default {
/** /** @version 3 */
* Set to true to generate an async entrypoint for the Vue bundle (for module federation support). experimental: {
* @version 3 /**
*/ * Set to true to generate an async entrypoint for the Vue bundle (for module federation support).
asyncEntry: { */
$resolve: (val, get) => val ?? (get('dev') && get('experimental.viteNode')) ?? false asyncEntry: {
}, $resolve: (val, get) => val ?? (get('dev') && get('experimental.viteNode')) ?? false
},
/** /**
* Use vite-node for on-demand server chunk loading * Use vite-node for on-demand server chunk loading
* @version 3 */
*/ viteNode: process.env.EXPERIMENTAL_VITE_NODE ? true : false,
viteNode: process.env.EXPERIMENTAL_VITE_NODE ? true : false,
/** /**
* Enable Vue's reactivity transform * Enable Vue's reactivity transform
* @see https://vuejs.org/guide/extras/reactivity-transform.html * @see https://vuejs.org/guide/extras/reactivity-transform.html
* @version 3 */
*/ reactivityTransform: false
reactivityTransform: false }
} }

View File

@ -45,6 +45,7 @@ export default {
...vite, ...vite,
...webpack, ...webpack,
...nitro, ...nitro,
...experimental,
// Legacy // Legacy
...build, ...build,
messages, messages,
@ -53,5 +54,4 @@ export default {
server, server,
cli, cli,
generate, generate,
experimental,
} }

View File

@ -1,11 +1,12 @@
/**
* @version 3
*/
export default { export default {
experimentNitropack: process.env.EXPERIMENT_NITROPACK ? true : false, experimentNitropack: process.env.EXPERIMENT_NITROPACK ? true : false,
/** /**
* Configuration for Nuxt Nitro.
*
* @typedef {Awaited<ReturnType<typeof import('nitropack')['NitroConfig']>>} * @typedef {Awaited<ReturnType<typeof import('nitropack')['NitroConfig']>>}
* @version 2
* @version 3
*/ */
nitro: {} nitro: {}
} }

View File

@ -1,4 +1,10 @@
export default { export default {
/**
* Configuration for Nuxt's TypeScript integration.
*
* @version 2
* @version 3
*/
typescript: { typescript: {
/** /**
* TypeScript comes with certain checks to give you more safety and analysis of your program. * TypeScript comes with certain checks to give you more safety and analysis of your program.