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,
|
|
|
|
|
|
|
|
/**
|
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
|
|
|
|
2023-04-06 11:51:32 +00:00
|
|
|
// TODO: move to `vue.runtimeCompiler` in v3.5
|
|
|
|
/**
|
|
|
|
* Include Vue compiler in runtime bundle.
|
|
|
|
*/
|
|
|
|
runtimeVueCompiler: false,
|
|
|
|
|
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-08-13 12:43:26 +00:00
|
|
|
/**
|
|
|
|
* Use vite-node for on-demand server chunk loading
|
|
|
|
*
|
|
|
|
* @deprecated use `vite.devBundler: 'vite-node'`
|
|
|
|
*/
|
|
|
|
viteNode: {
|
|
|
|
$resolve: (val) => {
|
|
|
|
val = process.env.EXPERIMENTAL_VITE_NODE ? true : val
|
|
|
|
if (val === true) {
|
|
|
|
console.warn('`vite-node` is now enabled by default. You can safely remove `experimental.viteNode` from your config.')
|
|
|
|
} else if (val === false) {
|
|
|
|
console.warn('`vite-node` is now enabled by default. To disable it, set `vite.devBundler` to `legacy` instead.')
|
|
|
|
}
|
|
|
|
return val ?? true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2022-08-08 13:25:58 +00:00
|
|
|
/**
|
2022-08-11 21:25:35 +00:00
|
|
|
* Split server bundle into multiple chunks and dynamically import them.
|
2022-08-08 13:25:58 +00:00
|
|
|
*
|
2023-01-19 19:37:07 +00:00
|
|
|
* @see https://github.com/nuxt/nuxt/issues/14525
|
2022-08-08 13:25:58 +00:00
|
|
|
*/
|
2022-09-03 13:03:30 +00:00
|
|
|
viteServerDynamicImports: true,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
noScripts: false,
|
2022-09-16 10:14:41 +00:00
|
|
|
|
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,
|
|
|
|
|
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-03 10:39:01 +00:00
|
|
|
polyfillVueUseHead: true,
|
|
|
|
|
|
|
|
/** 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,
|
2022-04-01 13:02:26 +00:00
|
|
|
}
|
2022-08-26 15:47:29 +00:00
|
|
|
})
|