Open leoj3n opened 8 months ago
Thank you for sharing. The adaptor only works with prerender because it will minify the rendered HTML page. If The prerender is false It will render during the SSR response the hooks way should be correct. Thank you for clarifying I will not in the README
Here are some hopefully helpful notes if you are just getting started with this and using Vercel adapter...
Having a root
+layout.js
like:And a
svelte.config.js
like:I was getting an error like:
So, I changed the config to:
Notice
svelte-kit/output/prerendered/pages
vs what I tried originally.svelte-kit/output
.This made it work; just thought I'd share if it helps anyone else using Vercel adapter.
Also note I learned you have to be using
export const prerender = true;
or else there is nothing to minify during "prerender".Furthermore, I found this alternate method working using the
html-minifier
package directly in./src/hooks.server.ts
:I think using this adapter plugin is a bit more elegant than that however.
Just sharing if it helps anyone, so feel free to make it a closed issue; and thanks for sharing this adapter adapter.