Skip to content
Discussion options

You must be logged in to vote

Add a src/routes/+layout.js file with

export const ssr = false;

This disables SSR for all pages and you can use libraries that only work in the browser without additional checks. See the docs for more details https://kit.svelte.dev/page-options#ssr

For the adapter you can use adapter-static with SPA mode: https://github.com/sveltejs/kit/tree/master/packages/adapter-static#spa-mode

svelte.config.js then looks something like this:

import adapter from '@sveltejs/adapter-static';

/** @type {import('@sveltejs/kit').Config} */
const config = {
  kit: {
    adapter: adapter({
      fallback: 'index.html',
    }),

    prerender: {
      entries: [],
    },
};

export default config;

Replies: 9 comments 22 replies

Comment options

You must be logged in to vote
4 replies
@rdela
Comment options

@OfficialCRUGG
Comment options

@mossaiby
Comment options

@OfficialCRUGG
Comment options

Answer selected by dummdidumm
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@Badlapje
Comment options

@mossaiby
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@dummdidumm
Comment options

@mossaiby
Comment options

Comment options

You must be logged in to vote
4 replies
@dummdidumm
Comment options

@mossaiby
Comment options

@BillBuilt
Comment options

@mossaiby
Comment options

Comment options

You must be logged in to vote
1 reply
@dummdidumm
Comment options

Comment options

You must be logged in to vote
1 reply
@mossaiby
Comment options

Comment options

You must be logged in to vote
8 replies
@RoyRao2333
Comment options

@infovore
Comment options

@RoyRao2333
Comment options

@infovore
Comment options

@RoyRao2333
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
10 participants
Converted from issue

This discussion was converted from issue #3364 on January 15, 2022 21:49.