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'
export default {
/** Vue.js config */
/**
* Vue.js config
* @version 2
* @version 3
*/
vue: {
/**
* 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.
*
* @type {'vite' | 'webpack' | { bundle: (nuxt: typeof import('../src/types/nuxt').Nuxt) => Promise<void> }}
* @version 3
*/
builder: {
$resolve: (val, get) => {
@ -21,7 +22,11 @@ export default {
return map[val] || (get('vite') === false ? map.webpack : map.vite)
},
},
/**
* Shared build configuration.
* @version 2
* @version 3
*/
build: {
/**
* Suppresses most of the build output log.

View File

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

View File

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

View File

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

View File

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