feat: enable hybrid rendering for nuxi build (#4373)

This commit is contained in:
pooya parsa 2022-04-15 18:31:19 +02:00 committed by GitHub
parent ea14a5c1c1
commit 83d27bd158
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -50,8 +50,10 @@ export async function initNitro (nuxt: Nuxt) {
.map(dir => ({ dir })) .map(dir => ({ dir }))
], ],
prerender: { prerender: {
crawlLinks: nuxt.options.generate.crawler, crawlLinks: nuxt.options._generate ? nuxt.options.generate.crawler : false,
routes: nuxt.options.generate.routes routes: []
.concat(nuxt.options.generate.routes)
.concat(nuxt.options.ssr === false ? ['/', '/200', '/404'] : [])
}, },
externals: { externals: {
inline: [ inline: [
@ -143,9 +145,7 @@ export async function initNitro (nuxt: Nuxt) {
} else { } else {
await prepare(nitro) await prepare(nitro)
await copyPublicAssets(nitro) await copyPublicAssets(nitro)
if (nuxt.options._generate || nuxt.options.target === 'static') { await prerender(nitro)
await prerender(nitro)
}
await build(nitro) await build(nitro)
} }
}) })

View File

@ -1,4 +1,5 @@
import { defineNuxtConfig } from 'nuxt3' import { defineNuxtConfig } from 'nuxt3'
export default defineNuxtConfig({ export default defineNuxtConfig({
ssr: false
}) })