Skip to content

Improve handling of compilerOptions.hydratable #120

@dominikg

Description

@dominikg

Describe the problem

Currently vite-plugin-svelte defaults to hydratable: true which is not the default for svelte and mostly due to the reason that it reliably works with and without ssr.

In situations where you don't use ssr and/or don't need clientside hydration, this leads to increased output size.

Describe the proposed solution

Only compile with hydratable: true when one of the following is true

  • compilerOptions.hydratable is set to true in svelte config
  • compilerOptions.hydratable is not defined in svelte config and viteConfig.ssr exists

Alternatives considered

stick with the current default. Users that want hydratable: false should set it in svelte config.

Importance

nice to have

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions