tailwindcss/integrations/vite
Philipp Spiess 89f291c007
Vite: Simplify preprocessor to make it work with Svelte 5 and Vite 6 (#15274)
Closes #15250

This PR simplifies our Vite integration even more. It turns out that in
some projects (see #15250 for the exact repro), the way we invoke
`svelte-preprocess` was actually causing issues in Vite since with Vite,
it's expected to use the `sveltePreprocess` version exported by
`sveltejs/vite-plugin-svelte`.

While trying to change this we noticed that there are different versions
of `sveltejs/vite-plugin-svelte` for Vite 5 and Vite 6 which caused us
to investigate even more and we noticed that we do not even need to
recursively call into the `sveltePreprocess()` as every plugin is run
after each other anyways. This allows us to drop the dependency on
`svelte-preprocess` and simplify the code a bit more, registering only a
`(string) => string` style transformer.

## Test Plan

This was tsted on the repro repo from #15250 as well as the SvelteKit
setup from [my
playgrounds](https://github.com/philipp-spiess/tailwindcss-playgrounds).
Furthermore we tested various combinations of `svelte`,
`@sveltejs/vite-plugin-svelte` and `vite` in our integration test to
ensure everything works as expected.

---------

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2024-12-02 14:48:00 -05:00
..
astro.test.ts Revert "Fix Astro integration test by pinning zod-to-json-schema" (#14792) 2024-10-25 11:31:34 +02:00
config.test.ts Update Vite to 6.0 (#15197) 2024-11-27 11:34:50 -05:00
css-modules.test.ts Update Vite to 6.0 (#15197) 2024-11-27 11:34:50 -05:00
index.test.ts Update Vite to 6.0 (#15197) 2024-11-27 11:34:50 -05:00
multi-root.test.ts Update Vite to 6.0 (#15197) 2024-11-27 11:34:50 -05:00
nuxt.test.ts Fix glob pattern hoisting on Windows (#14904) 2024-11-07 15:31:06 -05:00
other-transforms.test.ts Update Vite to 6.0 (#15197) 2024-11-27 11:34:50 -05:00
resolvers.test.ts Vite: Use Vite resolvers for CSS and JS files (#15173) 2024-11-27 11:48:55 -05:00
svelte.test.ts Vite: Simplify preprocessor to make it work with Svelte 5 and Vite 6 (#15274) 2024-12-02 14:48:00 -05:00
url-rewriting.test.ts Update Vite to 6.0 (#15197) 2024-11-27 11:34:50 -05:00
vue.test.ts Update Vite to 6.0 (#15197) 2024-11-27 11:34:50 -05:00