Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Sapper export, but without resolving [slug].svelte #1158

Closed
oreilles opened this issue Apr 15, 2020 · 1 comment
Closed

Sapper export, but without resolving [slug].svelte #1158

oreilles opened this issue Apr 15, 2020 · 1 comment

Comments

@oreilles
Copy link

I want to use Sapper for its lovely file-based routing system, but don't want its SSR. I'm essentially building a SPA that will only fetch its data through AWS functions, and I want to export the app as a static site so I don't have to manage a node server.

I can write all the logic I need in [slug].svelte files without any server routes. But then running sapper export will simply eliminate them because it couldn't generate a static html file for them.

Is there a way to have a very basic setup like the one below work with sapper export the same way it would with sapper build ?

[slug].svelte

<script>
    import { stores } from '@sapper/app';
    const { page } = stores();
</script>
<div>
    {JSON.stringify($page)}
</div>
@Conduitry
Copy link
Member

I believe there are other filesystem-based routing systems for Svelte that can be used for SPAs - but no, this isn't something that Sapper supports currently, and yes we know this is a feature lots of people want, and yes we know this is a feature that other people think is out of scope. See #383.

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

No branches or pull requests

2 participants