diff --git a/packages/schema/src/config/_app.ts b/packages/schema/src/config/_app.ts index 2887a0ab59..86de94b4fd 100644 --- a/packages/schema/src/config/_app.ts +++ b/packages/schema/src/config/_app.ts @@ -21,7 +21,7 @@ export default { performance: { $resolve: (val, get) => val ?? get('dev') }, }, /** - * Options for the Vue compiler that will be passed at build time + * Options for the Vue compiler that will be passed at build time. * @see [documentation](https://vuejs.org/api/application.html#app-config-compileroptions) * @type {typeof import('@vue/compiler-core').CompilerOptions} * @version 3 @@ -60,12 +60,12 @@ export default { /** * An absolute URL to serve the public folder from (production-only). * - * This can be set to a different value at runtime by setting the NUXT_APP_CDN_URL environment variable. + * This can be set to a different value at runtime by setting the `NUXT_APP_CDN_URL` environment variable. * @example * ```bash * NUXT_APP_CDN_URL=https://mycdn.org/ node .output/server/index.mjs * ``` - */ + */ cdnURL: { $resolve: (val, get) => get('dev') ? '' : (process.env.NUXT_APP_CDN_URL ?? val) || '' }, @@ -123,11 +123,11 @@ export default { return resolved } - }, + } }, /** - * The path to a templated HTML file for rendering Nuxt responses. - * Uses `/app.html` if it exists or the Nuxt default template if not. + * The path to an HTML template file for rendering Nuxt responses. + * Uses `/app.html` if it exists, or the Nuxt's default template if not. * * @example * ```html @@ -156,9 +156,9 @@ export default { }, /** - * Enable or disable vuex store. + * Enable or disable Vuex store. * - * By default it is enabled if there is a `store/` directory + * By default, it is enabled if there is a `store/` directory. * @version 2 */ store: { @@ -263,7 +263,7 @@ export default { * @example * ```js * css: [ - * // Load a Node.js module directly (here it's a Sass file) + * // Load a Node.js module directly (here it's a Sass file). * 'bulma', * // CSS file in the project * '@/assets/css/main.css', @@ -282,7 +282,7 @@ export default { /** * An object where each key name maps to a path to a layout .vue file. * - * Normally there is no need to configure this directly. + * Normally, there is no need to configure this directly. * @type {Record} * @version 2 */ @@ -291,7 +291,7 @@ export default { /** * Set a custom error page layout. * - * Normally there is no need to configure this directly. + * Normally, there is no need to configure this directly. * @type {string} * @version 2 */ @@ -304,11 +304,11 @@ export default { * @version 2 */ loading: { - /** CSS color of the progress bar */ + /** CSS color of the progress bar. */ color: 'black', /** * CSS color of the progress bar when an error appended while rendering - * the route (if data or fetch sent back an error for example). + * the route (if data or fetch sent back an error, for example). */ failedColor: 'red', /** Height of the progress bar (used in the style property of the progress bar). */ @@ -327,7 +327,7 @@ export default { continuous: false, /** Set the direction of the progress bar from right to left. */ rtl: false, - /** Set to false to remove default progress bar styles (and add your own). */ + /** Set to `false` to remove default progress bar styles (and add your own). */ css: true }, @@ -337,7 +337,7 @@ export default { * Set to `false` to disable. Alternatively, you can pass a string name or an object for more * configuration. The name can refer to an indicator from [SpinKit](https://tobiasahlin.com/spinkit/) * or a path to an HTML template of the indicator source code (in this case, all the - * other options will be passed to the template.) + * other options will be passed to the template). * @version 2 */ loadingIndicator: { diff --git a/packages/schema/src/config/_common.ts b/packages/schema/src/config/_common.ts index 3242a94a53..ba1ade34d9 100644 --- a/packages/schema/src/config/_common.ts +++ b/packages/schema/src/config/_common.ts @@ -8,7 +8,7 @@ import { RuntimeConfig } from '../types/config' export default { /** - * Extend nested configurations from multiple local or remote sources + * Extend nested configurations from multiple local or remote sources. * * Value should be either a string or array of strings pointing to source directories or config path relative to current config. * @@ -38,7 +38,7 @@ export default { /** * Define the source directory of your Nuxt application. * - * If a relative path is specified it will be relative to the `rootDir`. + * If a relative path is specified, it will be relative to the `rootDir`. * * @example * ```js @@ -91,22 +91,22 @@ export default { /** * Whether Nuxt is running in development mode. * - * Normally you should not need to set this. + * Normally, you should not need to set this. * @version 2 * @version 3 */ dev: Boolean(isDevelopment), /** - * Whether your app is being unit tested + * Whether your app is being unit tested. * @version 2 */ test: Boolean(isDevelopment), /** - * Set to true to enable debug mode. + * Set to `true` to enable debug mode. * - * By default it's only enabled in development mode. + * By default, it's only enabled in development mode. * @version 2 */ debug: { @@ -114,9 +114,9 @@ export default { }, /** - * The env property defines environment variables that should be available + * The `env` property defines environment variables that should be available * throughout your app (server- and client-side). They can be assigned using - * server side environment variables. + * server-side environment variables. * * @note Nuxt uses webpack's `definePlugin` to define these environment variables. * This means that the actual `process` or `process.env` from Node.js is neither @@ -185,7 +185,7 @@ export default { ssr: true, /** - * @deprecated use ssr option + * @deprecated use `ssr` option */ mode: { $resolve: (val, get) => val || (get('ssr') ? 'spa' : 'universal'), @@ -216,7 +216,7 @@ export default { modern: undefined, /** - * Modules are Nuxt extensions which can extend its core functionality and add endless integrations + * Modules are Nuxt extensions which can extend its core functionality and add endless integrations. * * Each module is either a string (which can refer to a package, or be a path to a file), a * tuple with the module as first string and the options as a second object, or an inline module function. @@ -248,7 +248,7 @@ export default { /** * Modules that are only required during development and build time. * - * Modules are Nuxt extensions which can extend its core functionality and add endless integrations + * Modules are Nuxt extensions which can extend its core functionality and add endless integrations. * * Each module is either a string (which can refer to a package, or be a path to a file), a * tuple with the module as first string and the options as a second object, or an inline module function. @@ -283,18 +283,18 @@ export default { buildModules: [], /** - * Built-in ad-hoc modules + * Built-in ad-hoc modules. * * @private */ _modules: [], /** - * Installed module metadata + * Installed module metadata. * * @version 3 * @private - */ + */ _installedModules: [], /** @@ -333,8 +333,8 @@ export default { * for an external server. * * You can pass a string, which can be the name of a node dependency or a path to a file. You - * can also pass an object with `path` and `handler` keys. (`handler` can be a path or a - * function.) + * can also pass an object with `path` and `handler` keys (`handler` can be a path or a + * function). * * @note If you pass a function directly, it will only run in development mode. * @@ -434,7 +434,7 @@ export default { }, /** - * Customize default directory structure used by nuxt. + * Customize default directory structure used by Nuxt. * * It is better to stick with defaults unless needed. * @version 2 @@ -442,7 +442,7 @@ export default { */ dir: { /** - * The assets directory (aliased as `~assets` in your build) + * The assets directory (aliased as `~assets` in your build). * @version 2 */ assets: 'assets', @@ -737,7 +737,7 @@ export default { * @type {typeof import('../src/types/config').PrivateRuntimeConfig} * @version 2 * @version 3 - * @deprecated Use `runtimeConfig` option + * @deprecated Use `runtimeConfig` option. */ privateRuntimeConfig: {}, @@ -745,7 +745,7 @@ export default { * @type {typeof import('../src/types/config').PublicRuntimeConfig} * @version 2 * @version 3 - * @deprecated Use `runtimeConfig` option with `public` key (`runtimeConfig.public.*`) + * @deprecated Use `runtimeConfig` option with `public` key (`runtimeConfig.public.*`). */ publicRuntimeConfig: {} } diff --git a/packages/schema/src/config/build.ts b/packages/schema/src/config/build.ts index e8a8ee612d..ab78aff522 100644 --- a/packages/schema/src/config/build.ts +++ b/packages/schema/src/config/build.ts @@ -20,7 +20,7 @@ export default { webpack: '@nuxt/webpack-builder', } return map[val] || (get('vite') === false ? map.webpack : map.vite) - }, + } }, /** * Whether to generate sourcemaps. @@ -159,7 +159,7 @@ export default { /** * Enable caching for [`terser-webpack-plugin`](https://github.com/webpack-contrib/terser-webpack-plugin#options) - * and [`cache-loader`](https://github.com/webpack-contrib/cache-loader#cache-loader) + * and [`cache-loader`](https://github.com/webpack-contrib/cache-loader#cache-loader). * * @warning This is an unstable feature. * @version 2 @@ -167,7 +167,7 @@ export default { cache: false, /** - * Inline server bundle dependencies + * Inline server bundle dependencies. * * This mode bundles `node_modules` that are normally preserved as externals in the server build. * @@ -618,7 +618,7 @@ export default { ] }, /** - * Set to `false` to disable the overlay provided by [FriendlyErrorsWebpackPlugin](https://github.com/nuxt/friendly-errors-webpack-plugin) + * Set to `false` to disable the overlay provided by [FriendlyErrorsWebpackPlugin](https://github.com/nuxt/friendly-errors-webpack-plugin). * @version 2 */ friendlyErrors: true, diff --git a/packages/schema/src/config/experimental.ts b/packages/schema/src/config/experimental.ts index f3256e542d..d59eca09ac 100644 --- a/packages/schema/src/config/experimental.ts +++ b/packages/schema/src/config/experimental.ts @@ -9,34 +9,34 @@ export default { }, /** - * Use vite-node for on-demand server chunk loading + * Use `vite-node` for on-demand server chunk loading. */ 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 */ reactivityTransform: false, /** - * Externalize `vue`, `@vue/*` and `vue-router` when build + * Externalize `vue`, `@vue/*` and `vue-router` when building. * @see https://github.com/nuxt/framework/issues/4084 */ externalVue: false, /** - * Tree shakes contents of client-only components from server bundle + * Tree shakes contents of client-only components from server bundle. * @see https://github.com/nuxt/framework/pull/5750 */ treeshakeClientOnly: false, /** - * Split server bundle into multiple chunks and dynamically import them + * Split server bundle into multiple chunks and dynamically import them. * * * @see https://github.com/nuxt/framework/issues/6432 */ - viteServerDynamicImports: true, + viteServerDynamicImports: true } } diff --git a/packages/schema/src/config/generate.ts b/packages/schema/src/config/generate.ts index 3d15e97847..b881d6b330 100644 --- a/packages/schema/src/config/generate.ts +++ b/packages/schema/src/config/generate.ts @@ -115,12 +115,12 @@ export default { * routes can be rendered (on the client-side) by Nuxt. * * * If unset or set to a falsy value, the name of the fallback HTML file will be `200.html`. - * * If set to true, the filename will be `404.html`. + * * If set to `true`, the filename will be `404.html`. * * If you provide a string as a value, it will be used instead. * * @note Multiple services (e.g. Netlify) detect a `404.html` automatically. If * you configure your web server on your own, please consult its documentation - * to find out how to set up an error page (and set it to the 404.html file) + * to find out how to set up an error page (and set it to the `404.html` file). */ fallback: { $resolve: val => val === true ? '400.html' : (val || '200.html') }, diff --git a/packages/schema/src/config/nitro.ts b/packages/schema/src/config/nitro.ts index 7a8aeb1f03..017a6816ed 100644 --- a/packages/schema/src/config/nitro.ts +++ b/packages/schema/src/config/nitro.ts @@ -1,17 +1,17 @@ export default { /** - * Configuration for Nitro + * Configuration for Nitro. * * @see https://nitro.unjs.io/config/ * * @type {typeof import('nitropack')['NitroConfig']} * @version 2 * @version 3 - */ + */ nitro: {}, /** - * Nitro server handlers + * Nitro server handlers. * * @see https://nitro.unjs.io/guide/routing.html * @@ -23,12 +23,12 @@ export default { serverHandlers: [], /** - * Nitro devevelopment-only server handlers + * Nitro development-only server handlers. * * @see https://nitro.unjs.io/guide/routing.html * * @type {typeof import('nitropack')['NitroDevEventHandler'][]} * @version 3 */ - devServerHandlers: [] + devServerHandlers: [] } diff --git a/packages/schema/src/config/render.ts b/packages/schema/src/config/render.ts index b44f7c2f31..7f71aca9c5 100644 --- a/packages/schema/src/config/render.ts +++ b/packages/schema/src/config/render.ts @@ -30,24 +30,24 @@ export default { /** * Whether to enable rendering of HTML - either dynamically (in server mode) or at generate time. * - * This option is automatically set based on global ssr value if not provided. - * This can be useful to dynamically enable/disable SSR on runtime after image builds - * (with docker for example). + * This option is automatically set based on global SSR value if not provided. + * This can be useful to dynamically enable/disable SSR at runtime after image builds + * (with docker, for example). */ ssr: undefined, /** - * Forward server-side logs to the browser for better debugging (only available in development) + * Forward server-side logs to the browser for better debugging (only available in development). * - * Set to `collapsed` to collapse the logs, or false to disable. + * Set to `collapsed` to collapse the logs, or `false` to disable. */ ssrLog: { $resolve: (val, get) => get('dev') ? Boolean(val) : false }, /** - * Configuration for HTTP2 push headers + * Configuration for HTTP2 push headers. */ http2: { - /** Set to true to enable HTTP2 push headers */ + /** Set to true to enable HTTP2 push headers. */ push: false, /** @deprecated */ shouldPush: null, @@ -142,7 +142,7 @@ export default { * to serve your SSR application. * * **Updating settings**: - * These settings are read by the Nuxt server directly from `nuxt.config.js`. + * These settings are read by the Nuxt server directly from `nuxt.config`. * This means changes to these settings take effect when the server is restarted. * There is no need to rebuild the application to update CSP settings. * @@ -169,7 +169,7 @@ export default { * for logging and analytic tracking. * * Review [this blog on Sentry.io](https://blog.sentry.io/2018/09/04/how-sentry-captures-csp-violations) - * To learn what tracking link you should use. + * to learn what tracking link you should use. * @example * ```js * // PRIMARY_HOSTS = `loc.example-website.com` @@ -226,7 +226,7 @@ export default { */ addMeta: Boolean(get('target') === 'static'), /** - * Set option `unsafeInlineCompatibility` to true if you want both hashes and + * Set option `unsafeInlineCompatibility` to `true` if you want both hashes and * 'unsafe-inline' for CSPv1 compatibility. In that case the `` tag will * still only contain the hashes of the inline `