Skip to content

Disable SSR (and CSR!) #231

@Rich-Harris

Description

@Rich-Harris

People often ask for SPA mode. We could do the following:

// svelte.config.js
module.exports = {
  adapter: '@sveltejs/adapter-node',
  serverSideRendering: false
};

(serverSideRendering: false might seem nonsensical in the context of adapter-node — why not just use adapter-static? — but we might still have dynamic endpoints, so it's something that should probably work with all adapters.)

Less commonly, people ask to disable client-side rendering (i.e. they just want SSR'd HTML, no interactivity) or at least client-side routing.

So we could have three new options that all default to true:

  • serverSideRendering
  • clientSideRendering
  • clientSideRouting

At least one of serverSideRendering or clientSideRendering would have to be true, and clientSideRouting couldn't be false if serverSideRendering was false.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions