Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

feat(nuxt): generate spa fallbacks for nuxt generate #7507

Merged
merged 2 commits into from
Sep 14, 2022
Merged

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Sep 14, 2022

πŸ”— Linked issue

Resolves nuxt/nuxt#13990

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This PR generates fallback SPA page for nuxt generate (ssr: true) in order to make fallback supported.

  • nuxt: generate + ssr: true (default): 200.html is generated (new) without being server-side rendered.
  • nuxt: generate + ssr: false: 200.html, 404.html and index.html (new) are generated

Nitro prerenderer detects this explicit routes and disable SSR for them. To avoid confusing with actually prerendering top level /, index.html is only pre-rendered for ssr: false. Also 404.html is only generated for ssr: false. It can be added for ssr: true using nitro.prerender.routes: ['/404.html'] if needed.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@netlify
Copy link

netlify bot commented Sep 14, 2022

βœ… Deploy Preview for nuxt3-docs canceled.

Name Link
πŸ”¨ Latest commit 90768e8
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/6321ef125480d7000873be3a

@pi0 pi0 changed the title feat(nuxt): generate spa fallback for nuxt generate feat(nuxt): generate spa fallbacks for nuxt generate Sep 14, 2022
@pi0 pi0 merged commit 9ee5ca2 into main Sep 14, 2022
@pi0 pi0 deleted the feat/200.html branch September 14, 2022 15:16
This was referenced Sep 14, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SSG] No 200.html is being rendered
2 participants