mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-21 16:09:52 +00:00
perf(nuxt): experimentally disable vue server renderer nitro endpoint (#19825)
This commit is contained in:
parent
fc9c3803b8
commit
562cef24ca
@ -232,6 +232,19 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) {
|
||||
handler: resolve(distDir, 'core/runtime/nitro/renderer')
|
||||
})
|
||||
|
||||
if (nuxt.options.experimental.noVueServer) {
|
||||
nitro.hooks.hook('rollup:before', (nitro) => {
|
||||
if (nitro.options.preset === 'nitro-prerender') { return }
|
||||
const nuxtErrorHandler = nitro.options.handlers.findIndex(h => h.route === '/__nuxt_error')
|
||||
if (nuxtErrorHandler >= 0) {
|
||||
nitro.options.handlers.splice(nuxtErrorHandler, 1)
|
||||
}
|
||||
// @ts-expect-error TODO: https://github.com/unjs/nitro/pull/1069
|
||||
nitro.options.renderer = undefined
|
||||
nitro.options.errorHandler = '#internal/nitro/error'
|
||||
})
|
||||
}
|
||||
|
||||
// Add typed route responses
|
||||
nuxt.hook('prepare:types', async (opts) => {
|
||||
if (!nuxt.options.dev) {
|
||||
|
@ -114,6 +114,11 @@ export default defineUntypedSchema({
|
||||
*/
|
||||
noScripts: false,
|
||||
|
||||
/**
|
||||
* Disable vue server renderer endpoint within nitro.
|
||||
*/
|
||||
noVueServer: false,
|
||||
|
||||
/**
|
||||
* When this option is enabled (by default) payload of pages generated with `nuxt generate` are extracted
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user