Commit 89f291c
Vite: Simplify preprocessor to make it work with Svelte 5 and Vite 6 (tailwindlabs#15274)
Closes tailwindlabs#15250
This PR simplifies our Vite integration even more. It turns out that in
some projects (see tailwindlabs#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 tailwindlabs#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>1 parent 667af25 commit 89f291c
File tree
5 files changed
+20
-164
lines changed- integrations/vite
- packages/@tailwindcss-vite
- src
5 files changed
+20
-164
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
42 | | - | |
| 41 | + | |
43 | 42 | | |
44 | 43 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
609 | 608 | | |
610 | 609 | | |
611 | 610 | | |
612 | | - | |
613 | | - | |
| 611 | + | |
| 612 | + | |
614 | 613 | | |
615 | 614 | | |
616 | 615 | | |
| |||
620 | 619 | | |
621 | 620 | | |
622 | 621 | | |
623 | | - | |
624 | | - | |
625 | | - | |
| 622 | + | |
626 | 623 | | |
627 | 624 | | |
628 | 625 | | |
629 | 626 | | |
630 | | - | |
631 | | - | |
632 | 627 | | |
633 | 628 | | |
634 | 629 | | |
635 | 630 | | |
636 | | - | |
637 | 631 | | |
638 | 632 | | |
639 | 633 | | |
640 | | - | |
641 | 634 | | |
642 | 635 | | |
643 | | - | |
| 636 | + | |
644 | 637 | | |
645 | 638 | | |
646 | 639 | | |
| |||
668 | 661 | | |
669 | 662 | | |
670 | 663 | | |
671 | | - | |
| 664 | + | |
672 | 665 | | |
673 | 666 | | |
674 | 667 | | |
675 | 668 | | |
676 | | - | |
| 669 | + | |
677 | 670 | | |
678 | 671 | | |
679 | | - | |
| 672 | + | |
680 | 673 | | |
681 | 674 | | |
682 | 675 | | |
| |||
0 commit comments