Skip to content

Conversation

mcous
Copy link
Collaborator

@mcous mcous commented Oct 11, 2024

If @testing-library/svelte is not set in the package.json of the project Vitest is running in (e.g. in certain monorepo setups), @sveltejs/vite-plugin-svelte will not detect that it needs to be inlined. This, in turn, breaks Svelte 5 support, which relies on STL running through the Svelte compiler for runes support.

Hopefully this is something that can be fixed in @sveltejs/vite-plugin-svelte, but it might not be! This PR updates our own Vite plugin to ensure this setting is correct, even if @sveltejs/vite-plugin-svelte misses it.

Fixes #403

@mcous mcous mentioned this pull request Oct 11, 2024
@mcous
Copy link
Collaborator Author

mcous commented Oct 11, 2024

Setup file has issues in the same monorepo setup this PR sets out to address, see playerfine/svelte5unittestingexample#1 (comment)

TODO

  • Disable auto cleanup if Vitest is in globals mode
  • Figure out why cleanup setupFiles addition fails in a monorepo, adjust as necessary
    • Cause: misconfiguration in example monorepo, Vitest and plugin behaving as expected
@mcous mcous merged commit b5e0f3d into main Oct 18, 2024
27 checks passed
@mcous mcous deleted the fix-monorepo-noexternal branch October 18, 2024 16:13
Copy link

🎉 This PR is included in version 5.2.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 participant