2022-08-26 15:47:29 +00:00
|
|
|
import { defineUntypedSchema } from 'untyped'
|
|
|
|
|
|
|
|
export default defineUntypedSchema({
|
2022-04-01 13:02:26 +00:00
|
|
|
experimental: {
|
|
|
|
/**
|
2022-04-16 13:53:36 +00:00
|
|
|
* Set to true to generate an async entry point for the Vue bundle (for module federation support).
|
2022-04-01 13:02:26 +00:00
|
|
|
*/
|
|
|
|
asyncEntry: {
|
2022-08-26 15:47:29 +00:00
|
|
|
$resolve: (val) => val ?? false
|
2022-04-01 13:02:26 +00:00
|
|
|
},
|
2022-03-11 08:41:27 +00:00
|
|
|
|
2022-04-01 13:02:26 +00:00
|
|
|
/**
|
2022-08-13 12:43:26 +00:00
|
|
|
* Enable Vue's reactivity transform
|
2022-04-01 13:02:26 +00:00
|
|
|
* @see https://vuejs.org/guide/extras/reactivity-transform.html
|
|
|
|
*/
|
2022-06-10 14:31:36 +00:00
|
|
|
reactivityTransform: false,
|
|
|
|
|
2023-04-07 10:05:09 +00:00
|
|
|
// TODO: Remove in v3.5 when nitro has support for mocking traced dependencies
|
|
|
|
// https://github.com/unjs/nitro/issues/1118
|
2022-06-10 14:31:36 +00:00
|
|
|
/**
|
2022-08-11 21:25:35 +00:00
|
|
|
* Externalize `vue`, `@vue/*` and `vue-router` when building.
|
2023-01-19 19:37:07 +00:00
|
|
|
* @see https://github.com/nuxt/nuxt/issues/13632
|
2022-06-10 14:31:36 +00:00
|
|
|
*/
|
2022-08-23 11:35:00 +00:00
|
|
|
externalVue: true,
|
2022-07-17 13:13:04 +00:00
|
|
|
|
|
|
|
/**
|
2022-08-11 21:25:35 +00:00
|
|
|
* Tree shakes contents of client-only components from server bundle.
|
2022-07-17 13:13:04 +00:00
|
|
|
* @see https://github.com/nuxt/framework/pull/5750
|
|
|
|
*/
|
2022-09-14 10:37:46 +00:00
|
|
|
treeshakeClientOnly: true,
|
2022-08-08 13:25:58 +00:00
|
|
|
|
2023-02-16 12:43:58 +00:00
|
|
|
/**
|
|
|
|
* Emit `app:chunkError` hook when there is an error loading vite/webpack
|
|
|
|
* chunks.
|
|
|
|
*
|
2023-03-08 12:17:22 +00:00
|
|
|
* By default, Nuxt will also perform a hard reload of the new route
|
2023-02-16 12:43:58 +00:00
|
|
|
* when a chunk fails to load when navigating to a new route.
|
|
|
|
*
|
2023-03-08 12:17:22 +00:00
|
|
|
* You can disable automatic handling by setting this to `false`, or handle
|
|
|
|
* chunk errors manually by setting it to `manual`.
|
|
|
|
*
|
2023-02-16 12:43:58 +00:00
|
|
|
* @see https://github.com/nuxt/nuxt/pull/19038
|
2023-03-08 12:17:22 +00:00
|
|
|
* @type {false | 'manual' | 'automatic'}
|
|
|
|
*/
|
|
|
|
emitRouteChunkError: {
|
|
|
|
$resolve: val => {
|
|
|
|
if (val === true) {
|
|
|
|
return 'manual'
|
|
|
|
}
|
|
|
|
if (val === 'reload') {
|
|
|
|
return 'automatic'
|
|
|
|
}
|
|
|
|
return val ?? 'automatic'
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether to restore Nuxt app state from `sessionStorage` when reloading the page
|
|
|
|
* after a chunk error or manual `reloadNuxtApp()` call.
|
|
|
|
*
|
|
|
|
* To avoid hydration errors, it will be applied only after the Vue app has been mounted,
|
|
|
|
* meaning there may be a flicker on initial load.
|
|
|
|
*
|
|
|
|
* Consider carefully before enabling this as it can cause unexpected behavior, and
|
|
|
|
* consider providing explicit keys to `useState` as auto-generated keys may not match
|
|
|
|
* across builds.
|
|
|
|
*
|
|
|
|
* @type {boolean}
|
2023-02-16 12:43:58 +00:00
|
|
|
*/
|
2023-03-08 12:17:22 +00:00
|
|
|
restoreState: false,
|
2023-02-16 12:43:58 +00:00
|
|
|
|
2022-09-03 13:03:30 +00:00
|
|
|
/**
|
|
|
|
* Inline styles when rendering HTML (currently vite only).
|
|
|
|
*
|
|
|
|
* You can also pass a function that receives the path of a Vue component
|
|
|
|
* and returns a boolean indicating whether to inline the styles for that component.
|
|
|
|
*
|
|
|
|
* @type {boolean | ((id?: string) => boolean)}
|
|
|
|
*/
|
|
|
|
inlineSSRStyles: {
|
2023-03-23 09:04:40 +00:00
|
|
|
async $resolve (val, get) {
|
2022-09-12 18:22:41 +00:00
|
|
|
if (val === false || (await get('dev')) || (await get('ssr')) === false || (await get('builder')) === '@nuxt/webpack-builder') {
|
2022-09-03 13:03:30 +00:00
|
|
|
return false
|
|
|
|
}
|
|
|
|
// Enabled by default for vite prod with ssr
|
|
|
|
return val ?? true
|
|
|
|
}
|
|
|
|
},
|
2022-09-05 13:46:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Turn off rendering of Nuxt scripts and JS resource hints.
|
2023-04-11 14:17:44 +00:00
|
|
|
* You can also disable scripts more granularly within `routeRules`.
|
2022-09-05 13:46:47 +00:00
|
|
|
*/
|
|
|
|
noScripts: false,
|
2022-09-16 10:14:41 +00:00
|
|
|
|
2023-04-07 10:34:35 +00:00
|
|
|
// TODO: enable by default in v3.5
|
|
|
|
/** Render JSON payloads with support for revivifying complex types. */
|
|
|
|
renderJsonPayloads: false,
|
|
|
|
|
2023-03-23 09:04:40 +00:00
|
|
|
/**
|
|
|
|
* Disable vue server renderer endpoint within nitro.
|
|
|
|
*/
|
|
|
|
noVueServer: false,
|
|
|
|
|
2022-09-16 10:14:41 +00:00
|
|
|
/**
|
|
|
|
* When this option is enabled (by default) payload of pages generated with `nuxt generate` are extracted
|
|
|
|
*/
|
2023-03-13 11:06:43 +00:00
|
|
|
payloadExtraction: undefined,
|
2022-10-17 11:15:29 +00:00
|
|
|
|
2023-03-08 21:13:06 +00:00
|
|
|
/**
|
|
|
|
* Whether to enable the experimental `<NuxtClientFallback>` component for rendering content on the client
|
|
|
|
* if there's an error in SSR.
|
|
|
|
*/
|
|
|
|
clientFallback: false,
|
|
|
|
|
2022-10-17 11:15:29 +00:00
|
|
|
/** Enable cross-origin prefetch using the Speculation Rules API. */
|
2022-10-17 20:20:13 +00:00
|
|
|
crossOriginPrefetch: false,
|
|
|
|
|
2023-04-10 11:33:14 +00:00
|
|
|
/**
|
|
|
|
* Enable View Transition API integration with client-side router.
|
|
|
|
*
|
|
|
|
* @see https://developer.chrome.com/docs/web-platform/view-transitions
|
|
|
|
*/
|
|
|
|
viewTransition: false,
|
|
|
|
|
2022-10-26 08:48:47 +00:00
|
|
|
/**
|
2022-10-26 08:28:41 +00:00
|
|
|
* Write early hints when using node server.
|
|
|
|
*
|
2022-10-26 08:48:47 +00:00
|
|
|
* @note nginx does not support 103 Early hints in the current version.
|
2022-10-26 08:28:41 +00:00
|
|
|
*/
|
2022-11-24 12:24:14 +00:00
|
|
|
writeEarlyHints: false,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Experimental component islands support with <NuxtIsland> and .island.vue files.
|
|
|
|
*/
|
2023-01-23 18:07:21 +00:00
|
|
|
componentIslands: false,
|
|
|
|
|
|
|
|
/**
|
2023-03-04 14:39:26 +00:00
|
|
|
* Config schema support
|
2023-01-23 18:07:21 +00:00
|
|
|
*
|
|
|
|
* @see https://github.com/nuxt/nuxt/issues/15592
|
|
|
|
*/
|
2023-03-08 15:32:24 +00:00
|
|
|
configSchema: true,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether or not to add a compatibility layer for modules, plugins or user code relying on the old
|
|
|
|
* `@vueuse/head` API.
|
|
|
|
*
|
|
|
|
* This can be disabled for most Nuxt sites to reduce the client-side bundle by ~0.5kb.
|
|
|
|
*/
|
2023-04-07 13:10:35 +00:00
|
|
|
polyfillVueUseHead: false,
|
2023-04-03 10:39:01 +00:00
|
|
|
|
|
|
|
/** Allow disabling Nuxt SSR responses by setting the `x-nuxt-no-ssr` header. */
|
|
|
|
respectNoSSRHeader: false,
|
2023-04-03 13:18:24 +00:00
|
|
|
|
|
|
|
/** Resolve `~`, `~~`, `@` and `@@` aliases located within layers with respect to their layer source and root directories. */
|
|
|
|
localLayerAliases: true,
|
2023-04-19 21:02:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set an alternative watcher that will be used as the watching service for Nuxt.
|
|
|
|
*
|
|
|
|
* Nuxt uses 'chokidar' by default, but by setting this to `parcel` it will use
|
|
|
|
* `@parcel/watcher` instead. This may improve performance in large projects or
|
|
|
|
* on Windows platforms.
|
|
|
|
*
|
|
|
|
* @see https://github.com/paulmillr/chokidar
|
|
|
|
* @see https://github.com/parcel-bundler/watcher
|
|
|
|
* @default chokidar
|
|
|
|
* @type {'chokidar' | 'parcel'}
|
|
|
|
*/
|
|
|
|
watcher: 'chokidar'
|
2022-04-01 13:02:26 +00:00
|
|
|
}
|
2022-08-26 15:47:29 +00:00
|
|
|
})
|