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.
|
2022-06-10 14:31:36 +00:00
|
|
|
* @see https://github.com/nuxt/framework/issues/4084
|
|
|
|
*/
|
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
|
|
|
|
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
|
|
|
*
|
|
|
|
* @see https://github.com/nuxt/framework/issues/6432
|
|
|
|
*/
|
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: {
|
2022-10-27 10:36:37 +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
|
|
|
|
|
|
|
/**
|
|
|
|
* When this option is enabled (by default) payload of pages generated with `nuxt generate` are extracted
|
|
|
|
*/
|
2022-11-15 16:27:34 +00:00
|
|
|
payloadExtraction: {
|
|
|
|
async $resolve(enabled, get) {
|
|
|
|
enabled = enabled ?? false
|
|
|
|
if (enabled) {
|
|
|
|
console.warn('Using experimental payload extraction for full-static output. You can opt-out by setting `experimental.payloadExtraction` to `false`.')
|
|
|
|
}
|
|
|
|
return enabled
|
|
|
|
}
|
|
|
|
},
|
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-10-26 08:48:47 +00:00
|
|
|
writeEarlyHints: false
|
2022-04-01 13:02:26 +00:00
|
|
|
}
|
2022-08-26 15:47:29 +00:00
|
|
|
})
|