Skip to content

Commit

Permalink
feat: enable hybrid rendering for nuxi build (nuxt#4373)
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 authored Apr 15, 2022
1 parent ea14a5c commit 83d27bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/nuxt3/src/core/nitro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ export async function initNitro (nuxt: Nuxt) {
.map(dir => ({ dir }))
],
prerender: {
crawlLinks: nuxt.options.generate.crawler,
routes: nuxt.options.generate.routes
crawlLinks: nuxt.options._generate ? nuxt.options.generate.crawler : false,
routes: []
.concat(nuxt.options.generate.routes)
.concat(nuxt.options.ssr === false ? ['/', '/200', '/404'] : [])
},
externals: {
inline: [
Expand Down Expand Up @@ -143,9 +145,7 @@ export async function initNitro (nuxt: Nuxt) {
} else {
await prepare(nitro)
await copyPublicAssets(nitro)
if (nuxt.options._generate || nuxt.options.target === 'static') {
await prerender(nitro)
}
await prerender(nitro)
await build(nitro)
}
})
Expand Down
1 change: 1 addition & 0 deletions playground/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineNuxtConfig } from 'nuxt3'

export default defineNuxtConfig({
ssr: false
})

0 comments on commit 83d27bd

Please sign in to comment.