svelte-to-html is a command to quickly transform a Svelte file into static html.
Props can be supplied to the main Svelte file.
The main Svelte file can import other Svelte components or JavaScript files.
What this is not?
This command is not a replacement for SvelteKit. It does not ship any JavaScript nor does it include any head or body tag.
It obviously does not support any DOM APIs like window, location, navigator etc.
Why?
For scenarios where you'd want to generate a static HTML file but with if/else conditionals or for loops. Svelte's templating features and syntax come to rescue.
Ideal for creating templates for GitHub comments which can be used in GitHub Actions.
<!-- template.svelte -->
<script>
consta=5;constb=8;exportlet numbers = [];
</script>
<ul>
{#eachnumbersasnumber}
<li>{number}</li>
{/each}
</ul>
{#ifa<b}
<p>a is less than b</p>
{:else}
<p>b is less than a</p>
{/if}