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
|
2023-07-14 13:46:40 +00:00
|
|
|
*
|
|
|
|
* Warning: Reactivity transform feature has been marked as deprecated in Vue 3.3 and is planned to be
|
2023-06-09 21:24:39 +00:00
|
|
|
* removed from core in Vue 3.4.
|
|
|
|
* @see https://github.com/vuejs/rfcs/discussions/369#discussioncomment-5059028
|
2022-04-01 13:02:26 +00:00
|
|
|
*/
|
2022-06-10 14:31:36 +00:00
|
|
|
reactivityTransform: false,
|
|
|
|
|
2023-05-10 21:57:51 +00:00
|
|
|
// TODO: Remove in v3.6 when nitro has support for mocking traced dependencies
|
2023-04-07 10:05:09 +00:00
|
|
|
// 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
|
|
|
/** Render JSON payloads with support for revivifying complex types. */
|
2023-05-10 22:31:13 +00:00
|
|
|
renderJsonPayloads: true,
|
2023-04-07 10:34:35 +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-07-14 13:46:40 +00:00
|
|
|
*
|
2023-06-08 21:50:29 +00:00
|
|
|
* @type {boolean | undefined}
|
2022-09-16 10:14:41 +00:00
|
|
|
*/
|
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-07-31 12:01:50 +00:00
|
|
|
* @type {true | 'local' | 'local+remote' | false}
|
2022-11-24 12:24:14 +00:00
|
|
|
*/
|
2023-07-31 12:01:50 +00:00
|
|
|
componentIslands: {
|
|
|
|
$resolve: (val) => {
|
|
|
|
if (typeof val === 'string') { return val }
|
|
|
|
if (val === true) { return 'local' }
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
},
|
2023-01-23 18:07:21 +00:00
|
|
|
|
|
|
|
/**
|
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,
|
|
|
|
|
2023-07-14 13:46:40 +00:00
|
|
|
/**
|
|
|
|
* This enables 'Bundler' module resolution mode for TypeScript, which is the recommended setting
|
|
|
|
* for frameworks like Nuxt and Vite.
|
|
|
|
*
|
|
|
|
* It improves type support when using modern libraries with `exports`.
|
|
|
|
*
|
|
|
|
* This is only not enabled by default because it could be a breaking change for some projects.
|
|
|
|
*
|
|
|
|
* See https://github.com/microsoft/TypeScript/pull/51669
|
|
|
|
*/
|
|
|
|
typescriptBundlerResolution: {
|
|
|
|
async $resolve (val, get) {
|
|
|
|
if (typeof val === 'boolean') { return val }
|
|
|
|
const setting = await get('typescript.tsConfig.compilerOptions.moduleResolution')
|
|
|
|
if (setting) {
|
|
|
|
return setting.toLowerCase() === 'bundler'
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2023-03-08 15:32:24 +00:00
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
2023-05-09 17:08:07 +00:00
|
|
|
/** Enable the new experimental typed router using [unplugin-vue-router](https://github.com/posva/unplugin-vue-router). */
|
|
|
|
typedPages: false,
|
|
|
|
|
2023-04-19 21:02:52 +00:00
|
|
|
/**
|
|
|
|
* Set an alternative watcher that will be used as the watching service for Nuxt.
|
|
|
|
*
|
2023-05-18 13:44:24 +00:00
|
|
|
* Nuxt uses 'chokidar-granular' by default, which will ignore top-level directories
|
|
|
|
* (like `node_modules` and `.git`) that are excluded from watching.
|
|
|
|
*
|
|
|
|
* You can set this instead to `parcel` to use `@parcel/watcher`, which may improve
|
|
|
|
* performance in large projects or on Windows platforms.
|
|
|
|
*
|
|
|
|
* You can also set this to `chokidar` to watch all files in your source directory.
|
2023-04-19 21:02:52 +00:00
|
|
|
*
|
|
|
|
* @see https://github.com/paulmillr/chokidar
|
|
|
|
* @see https://github.com/parcel-bundler/watcher
|
2023-05-18 13:44:24 +00:00
|
|
|
* @type {'chokidar' | 'parcel' | 'chokidar-granular'}
|
2023-04-19 21:02:52 +00:00
|
|
|
*/
|
2023-08-01 19:47:31 +00:00
|
|
|
watcher: 'chokidar-granular',
|
|
|
|
|
|
|
|
/**
|
2023-08-03 06:15:43 +00:00
|
|
|
* Add the capo.js head plugin in order to render tags in of the head in a more performant way.
|
|
|
|
*
|
|
|
|
* @see https://rviscomi.github.io/capo.js/user/rules/
|
2023-08-01 19:47:31 +00:00
|
|
|
*/
|
|
|
|
headCapoPlugin: false
|
2022-04-01 13:02:26 +00:00
|
|
|
}
|
2022-08-26 15:47:29 +00:00
|
|
|
})
|