Skip to content

vitePreprocess script is breaking snippet export svelte 5Β #15681

@neo-noire

Description

@neo-noire

Describe the bug

Just figured out that vitePreprocess({ script: true}) is breaking snippets export from <script lang="ts" module> .
I know that you do not need to use script option in svelte5, but not using it will break my enums that are defined inside <script> tags.

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-ldkwkg71?file=svelte.config.js

Logs

System Info

System:
    OS: macOS 15.4
    CPU: (10) arm64 Apple M2 Pro
    Memory: 185.34 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.10.0 - ~/.nvm/versions/node/v22.10.0/bin/node
    npm: 10.3.0 - ~/Desktop/work/project_name/node_modules/.bin/npm
    pnpm: 10.5.2 - /opt/homebrew/bin/pnpm
  Browsers:
    Chrome: 134.0.6998.166
    Edge: 134.0.3124.95
    Safari: 18.4
  npmPackages:
    svelte: ^5.19.9 => 5.20.0

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions