Adapter static does not export an index.html for root redirect
Describe the bug
When using adapter static with a redirect server root, no root index.html is exported.
This results in a 404 error when fetching the root index.html, instead of redirecting to the wanted location.
src/
- routes/
- index.ts --> this one redirects to en/index.svelte
- en/
- index.svelte
What happens:
No root index.html is created when exporting with adapter static.
That is normal, since server routes are simply ignored, but :
What i'd like
- Emit a warning about using adapter static with a repo that has server routes.
- // MAYBE?? Provide a better way to use redirect routes
Workaround
replace index.ts with index.svelte and put the script content in <script context="module>
Reproduction
coming soon
Logs
No response
System Info
Github Pages
Severity
annoyance
Additional Information
No response
i just started recently with sveltekit with latest 1.0.0-next.303 and npm run build didnt create an index.html file too. downgrading in package.json:
@sveltejs/adapter-static": "1.0.0-next.28",
"@sveltejs/kit": "1.0.0-next.291"
did the trick, now it creates the index.html file also doing that i got some strange error during npm install, or warning i dont know, about "prepare": "svelte-kit sync", i just erased that line. Any recommendations, updates about this? thank you
This was fixed some time ago - adapter-static now includes a index.html which includes a meta tag with a redirect.