Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow dynamic index.svelte route (not prerendered) #5

Closed
geoffrich opened this issue Oct 24, 2021 · 3 comments · Fixed by #22
Closed

Allow dynamic index.svelte route (not prerendered) #5

geoffrich opened this issue Oct 24, 2021 · 3 comments · Fixed by #22

Comments

@geoffrich
Copy link
Owner

Azure SWA require an index.html file to be present. At the moment, this means your root index.svelte route needs to be prerendered.

We should also support a dynamic index route that is SSR'd at request time. Potential approach:

  • Detect if index.html was prerendered. If so, do nothing.
  • Otherwise, create an empty index.html to make the build succeed. Update the routing rules to redirect requests for / to the api/__render function instead. I suspect the routing update is needed so Azure doesn't serve the empty HTML file instead.

See also: #2, #4

@geoffrich
Copy link
Owner Author

sveltejs/kit#2675 should help with detecting if index.html was prerendered.

@geoffrich
Copy link
Owner Author

Blocked by sveltejs/kit#3099.

@geoffrich
Copy link
Owner Author

svelte-adapter-azure-swa@0.3.0 no longer requires index.svelte to be prerendered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant