diff --git a/packages/schema/src/config/_app.ts b/packages/schema/src/config/_app.ts index 2fcbe139aa..2e69bdc022 100644 --- a/packages/schema/src/config/_app.ts +++ b/packages/schema/src/config/_app.ts @@ -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. diff --git a/packages/schema/src/config/build.ts b/packages/schema/src/config/build.ts index ba29cb03c7..efab93b7f9 100644 --- a/packages/schema/src/config/build.ts +++ b/packages/schema/src/config/build.ts @@ -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 }} + * @version 3 */ builder: { $resolve: (val, get) => { @@ -21,17 +22,21 @@ export default { return map[val] || (get('vite') === false ? map.webpack : map.vite) }, }, - - 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) + /** + * Shared build configuration. * @version 2 * @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), /** diff --git a/packages/schema/src/config/experimental.ts b/packages/schema/src/config/experimental.ts index a289fca2bf..947fe7b947 100644 --- a/packages/schema/src/config/experimental.ts +++ b/packages/schema/src/config/experimental.ts @@ -1,22 +1,22 @@ export default { - /** - * 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 - }, + /** @version 3 */ + experimental: { + /** + * 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 + }, - /** - * Use vite-node for on-demand server chunk loading - * @version 3 - */ - viteNode: process.env.EXPERIMENTAL_VITE_NODE ? true : false, + /** + * Use vite-node for on-demand server chunk loading + */ + 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 + /** + * Enable Vue's reactivity transform + * @see https://vuejs.org/guide/extras/reactivity-transform.html + */ + reactivityTransform: false + } } diff --git a/packages/schema/src/config/index.ts b/packages/schema/src/config/index.ts index a3184b48ae..adeb87e097 100644 --- a/packages/schema/src/config/index.ts +++ b/packages/schema/src/config/index.ts @@ -45,6 +45,7 @@ export default { ...vite, ...webpack, ...nitro, + ...experimental, // Legacy ...build, messages, @@ -53,5 +54,4 @@ export default { server, cli, generate, - experimental, } diff --git a/packages/schema/src/config/nitro.ts b/packages/schema/src/config/nitro.ts index 87f4238945..7b3257dd85 100644 --- a/packages/schema/src/config/nitro.ts +++ b/packages/schema/src/config/nitro.ts @@ -1,11 +1,12 @@ -/** - * @version 3 - */ export default { experimentNitropack: process.env.EXPERIMENT_NITROPACK ? true : false, /** + * Configuration for Nuxt Nitro. + * * @typedef {Awaited>} + * @version 2 + * @version 3 */ nitro: {} } diff --git a/packages/schema/src/config/typescript.ts b/packages/schema/src/config/typescript.ts index 7d4c34c32f..1fa89a4bf5 100644 --- a/packages/schema/src/config/typescript.ts +++ b/packages/schema/src/config/typescript.ts @@ -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.