Search code examples
server-side-renderingsveltesappersvelte-3

Svelte3 adding <svelte:head> without Sapper?


After all day following the google rabbit hole, I’m still wondering about google/bing/etc being able to crawl svelte apps. I want to convert my personal portfolio to svelte, which will be a SPA. If I add tags for the header data on the svelte SPA, will google pick it up, or do I need ssr for google to see the rendered page?


Solution

  • Google crawlers will most likely run your JavaScript so that the title etc. inside <svelte:head> is picked up, but Bing and others will not.

    If you go with Sapper you can use sapper export on your site to get a pre-rendered html/svelte hybrid which will solve your issue.