Skip to content

fix(vercel, azure): serve prerendered routes statically - #500

Merged
pi0 merged 11 commits into
mainfrom
fix/vercel-static
Sep 14, 2022
Merged

pi0 merged 11 commits into
mainfrom
fix/vercel-static

Conversation

@danielroe

Copy link
Copy Markdown
Member

🔗 Linked issue

❓ 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

Current hybrid vercel deployments will always server-render prerendered HTML (though you can get the static html by adding /index.html to the URL). Vercel provides the overrides property to allow us to map clean URLs (without .html or index.html suffix) to static files: https://vercel.com/docs/build-output-api/v3#build-output-configuration/supported-properties/overrides. This PR implements that.

Might also be worth a consistent implementation of accessing which HTML files have been prerendered. (See this line for how we were doing it in Azure - I could easily create a shared context that both presets could use - happy to pick this up.)

📝 Checklist

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

@danielroe danielroe added the bug Something isn't working (PRs; issues use the Bug type) label Sep 14, 2022
@danielroe
danielroe requested a review from pi0 September 14, 2022 11:53
@danielroe danielroe self-assigned this Sep 14, 2022
@codecov

codecov Bot commented Sep 14, 2022 •

Copy link
Copy Markdown

Codecov Report

Merging #500 (a460eea) into main (2dd05fb) will decrease coverage by 0.14%.
The diff coverage is 54.83%.

@@            Coverage Diff             @@
##             main     #500      +/-   ##
==========================================
- Coverage   63.62%   63.48%   -0.15%     
==========================================
  Files          55       55              
  Lines        3634     3620      -14     
  Branches      394      392       -2     
==========================================
- Hits         2312     2298      -14     
+ Misses       1309     1308       -1     
- Partials       13       14       +1     
Impacted Files Coverage Δ
src/types/nitro.ts 100.00% <ø> (ø)
src/presets/azure.ts 13.67% <13.04%> (-0.04%) ⬇️
src/presets/vercel.ts 65.04% <78.37%> (-8.17%) ⬇️
src/prerender.ts 86.74% <100.00%> (+0.16%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Comment thread src/presets/vercel.ts Resolved
Comment thread src/presets/vercel.ts Resolved
@pi0 pi0 changed the title fix(vercel): serve prerendered routes statically fix(vercel, azure): serve prerendered routes statically Sep 14, 2022

This branch was successfully deployed

1 active deployment
Preview — a460eead Deployed Sep 14, 2022 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working (PRs; issues use the Bug type)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants