@@ -57,19 +57,19 @@ test(
57
57
<h1 class="global local underline">Hello {name}!</h1>
58
58
59
59
<style>
60
- @import 'tailwindcss' reference;
61
60
@import './other.css';
61
+ @reference 'tailwindcss';
62
62
</style>
63
63
` ,
64
64
'src/other.css' : css `
65
65
.local {
66
66
@apply text-red-500;
67
- animation: 2s ease-in-out 0s infinite localKeyframes;
67
+ animation: 2s ease-in-out infinite localKeyframes;
68
68
}
69
69
70
70
:global(.global) {
71
71
@apply text-green-500;
72
- animation: 2s ease-in-out 0s infinite globalKeyframes;
72
+ animation: 2s ease-in-out infinite globalKeyframes;
73
73
}
74
74
75
75
@keyframes -global-globalKeyframes {
@@ -93,18 +93,21 @@ test(
93
93
} ,
94
94
} ,
95
95
async ( { exec, fs, expect } ) => {
96
- await exec ( 'pnpm vite build' )
96
+ let output = await exec ( 'pnpm vite build' )
97
97
98
98
let files = await fs . glob ( 'dist/**/*.css' )
99
99
expect ( files ) . toHaveLength ( 1 )
100
100
101
101
await fs . expectFileToContain ( files [ 0 ] [ 0 ] , [
102
102
candidate `underline` ,
103
- '.global{color:var(--color-green-500);animation:2s ease-in-out 0s infinite globalKeyframes}' ,
104
- / \. l o c a l .s v e l t e - .* \{ c o l o r : v a r \( - - c o l o r - r e d - 5 0 0 \) ; a n i m a t i o n : 2 s e a s e - i n - o u t 0 s i n f i n i t e s v e l t e - .* - l o c a l K e y f r a m e s \} / ,
103
+ '.global{color:var(--color-green-500);animation:2s ease-in-out infinite globalKeyframes}' ,
104
+ / \. l o c a l .s v e l t e - .* \{ c o l o r : v a r \( - - c o l o r - r e d - 5 0 0 \) ; a n i m a t i o n : 2 s e a s e - i n - o u t i n f i n i t e s v e l t e - .* - l o c a l K e y f r a m e s \} / ,
105
105
/ @ k e y f r a m e s g l o b a l K e y f r a m e s \{ / ,
106
106
/ @ k e y f r a m e s s v e l t e - .* - l o c a l K e y f r a m e s \{ / ,
107
107
] )
108
+
109
+ // Should not print any warnings
110
+ expect ( output ) . not . toContain ( 'vite-plugin-svelte' )
108
111
} ,
109
112
)
110
113
@@ -164,20 +167,20 @@ test(
164
167
<h1 class="local global underline">Hello {name}!</h1>
165
168
166
169
<style>
167
- @import 'tailwindcss' reference;
168
170
@import './other.css';
171
+ @reference 'tailwindcss';
169
172
</style>
170
173
` ,
171
174
'src/index.css' : css ` @import 'tailwindcss'; ` ,
172
175
'src/other.css' : css `
173
176
.local {
174
177
@apply text-red-500;
175
- animation: 2s ease-in-out 0s infinite localKeyframes;
178
+ animation: 2s ease-in-out infinite localKeyframes;
176
179
}
177
180
178
181
:global(.global) {
179
182
@apply text-green-500;
180
- animation: 2s ease-in-out 0s infinite globalKeyframes;
183
+ animation: 2s ease-in-out infinite globalKeyframes;
181
184
}
182
185
183
186
@keyframes -global-globalKeyframes {
@@ -210,10 +213,10 @@ test(
210
213
let [ , css ] = files [ 0 ]
211
214
expect ( css ) . toContain ( candidate `underline` )
212
215
expect ( css ) . toContain (
213
- '.global{color:var(--color-green-500);animation:2s ease-in-out 0s infinite globalKeyframes}' ,
216
+ '.global{color:var(--color-green-500);animation:2s ease-in-out infinite globalKeyframes}' ,
214
217
)
215
218
expect ( css ) . toMatch (
216
- / \. l o c a l .s v e l t e - .* \{ c o l o r : v a r \( - - c o l o r - r e d - 5 0 0 \) ; a n i m a t i o n : 2 s e a s e - i n - o u t 0 s i n f i n i t e s v e l t e - .* - l o c a l K e y f r a m e s \} / ,
219
+ / \. l o c a l .s v e l t e - .* \{ c o l o r : v a r \( - - c o l o r - r e d - 5 0 0 \) ; a n i m a t i o n : 2 s e a s e - i n - o u t i n f i n i t e s v e l t e - .* - l o c a l K e y f r a m e s \} / ,
217
220
)
218
221
expect ( css ) . toMatch ( / @ k e y f r a m e s g l o b a l K e y f r a m e s \{ / )
219
222
expect ( css ) . toMatch ( / @ k e y f r a m e s s v e l t e - .* - l o c a l K e y f r a m e s \{ / )
@@ -235,10 +238,10 @@ test(
235
238
let [ , css ] = files [ 0 ]
236
239
expect ( css ) . toContain ( candidate `font-bold` )
237
240
expect ( css ) . toContain (
238
- '.global{color:var(--color-green-500);animation:2s ease-in-out 0s infinite globalKeyframes}' ,
241
+ '.global{color:var(--color-green-500);animation:2s ease-in-out infinite globalKeyframes}' ,
239
242
)
240
243
expect ( css ) . toMatch (
241
- / \. l o c a l .s v e l t e - .* \{ c o l o r : v a r \( - - c o l o r - r e d - 5 0 0 \) ; a n i m a t i o n : 2 s e a s e - i n - o u t 0 s i n f i n i t e s v e l t e - .* - l o c a l K e y f r a m e s \} / ,
244
+ / \. l o c a l .s v e l t e - .* \{ c o l o r : v a r \( - - c o l o r - r e d - 5 0 0 \) ; a n i m a t i o n : 2 s e a s e - i n - o u t i n f i n i t e s v e l t e - .* - l o c a l K e y f r a m e s \} / ,
242
245
)
243
246
expect ( css ) . toMatch ( / @ k e y f r a m e s g l o b a l K e y f r a m e s \{ / )
244
247
expect ( css ) . toMatch ( / @ k e y f r a m e s s v e l t e - .* - l o c a l K e y f r a m e s \{ / )
0 commit comments