@@ -14,12 +14,7 @@ import {
14
14
yaml ,
15
15
} from '../utils'
16
16
17
- describe . each ( [
18
- [ 'postcss' , 'module-graph' ] ,
19
- [ 'postcss' , 'file-system' ] ,
20
- [ 'lightningcss' , 'module-graph' ] ,
21
- [ 'lightningcss' , 'file-system' ] ,
22
- ] ) ( 'using %s via %s' , ( transformer , scanner ) => {
17
+ describe . each ( [ 'postcss' , 'lightningcss' ] ) ( '%s' , ( transformer ) => {
23
18
test (
24
19
`production build` ,
25
20
{
@@ -50,7 +45,7 @@ describe.each([
50
45
export default defineConfig({
51
46
css: ${ transformer === 'postcss' ? '{}' : "{ transformer: 'lightningcss' }" } ,
52
47
build: { cssMinify: false },
53
- plugins: [tailwindcss({ scanner: ' ${ scanner } ' } )],
48
+ plugins: [tailwindcss()],
54
49
})
55
50
` ,
56
51
'project-a/index.html' : html `
@@ -62,7 +57,9 @@ describe.each([
62
57
</body>
63
58
` ,
64
59
'project-a/tailwind.config.js' : js `
65
- export default { content: ['../project-b/src/**/*.js'] }
60
+ export default {
61
+ content: ['../project-b/src/**/*.js'],
62
+ }
66
63
` ,
67
64
'project-a/src/index.css' : css `
68
65
@import 'tailwindcss/theme' theme(reference);
@@ -125,7 +122,7 @@ describe.each([
125
122
export default defineConfig({
126
123
css: ${ transformer === 'postcss' ? '{}' : "{ transformer: 'lightningcss' }" } ,
127
124
build: { cssMinify: false },
128
- plugins: [tailwindcss({ scanner: ' ${ scanner } ' } )],
125
+ plugins: [tailwindcss()],
129
126
})
130
127
` ,
131
128
'project-a/index.html' : html `
@@ -145,7 +142,9 @@ describe.each([
145
142
</body>
146
143
` ,
147
144
'project-a/tailwind.config.js' : js `
148
- export default { content: ['../project-b/src/**/*.js'] }
145
+ export default {
146
+ content: ['../project-b/src/**/*.js'],
147
+ }
149
148
` ,
150
149
'project-a/src/index.css' : css `
151
150
@import 'tailwindcss/theme' theme(reference);
@@ -163,7 +162,9 @@ describe.each([
163
162
} ,
164
163
} ,
165
164
async ( { root, spawn, fs, expect } ) => {
166
- let process = await spawn ( 'pnpm vite dev' , { cwd : path . join ( root , 'project-a' ) } )
165
+ let process = await spawn ( 'pnpm vite dev' , {
166
+ cwd : path . join ( root , 'project-a' ) ,
167
+ } )
167
168
await process . onStdout ( ( m ) => m . includes ( 'ready in' ) )
168
169
169
170
let url = ''
@@ -173,19 +174,17 @@ describe.each([
173
174
return Boolean ( url )
174
175
} )
175
176
176
- // Candidates are resolved lazily in module-graph mode , so the first visit of index.html will
177
- // only have candidates from this file.
177
+ // Candidates are resolved lazily, so the first visit of index.html
178
+ // will only have candidates from this file.
178
179
await retryAssertion ( async ( ) => {
179
180
let styles = await fetchStyles ( url , '/index.html' )
180
181
expect ( styles ) . toContain ( candidate `underline` )
181
182
expect ( styles ) . toContain ( candidate `flex` )
182
-
183
- if ( scanner === 'module-graph' ) {
184
- expect ( styles ) . not . toContain ( candidate `font-bold` )
185
- }
183
+ expect ( styles ) . not . toContain ( candidate `font-bold` )
186
184
} )
187
185
188
- // Going to about.html will extend the candidate list to include candidates from about.html.
186
+ // Going to about.html will extend the candidate list to include
187
+ // candidates from about.html.
189
188
await retryAssertion ( async ( ) => {
190
189
let styles = await fetchStyles ( url , '/about.html' )
191
190
expect ( styles ) . toContain ( candidate `underline` )
@@ -233,8 +232,8 @@ describe.each([
233
232
} )
234
233
235
234
await retryAssertion ( async ( ) => {
236
- // After updates to the CSS file, all previous candidates should still be in the generated
237
- // stylesheet.
235
+ // After updates to the CSS file, all previous candidates should still be in
236
+ // the generated CSS
238
237
await fs . write (
239
238
'project-a/src/index.css' ,
240
239
css `
@@ -284,7 +283,10 @@ describe.each([
284
283
import tailwindcss from '@tailwindcss/vite'
285
284
import { defineConfig } from 'vite'
286
285
287
- export default defineConfig({ build: { cssMinify: false }, plugins: [tailwindcss()] })
286
+ export default defineConfig({
287
+ build: { cssMinify: false },
288
+ plugins: [tailwindcss()],
289
+ })
288
290
` ,
289
291
'project-a/index.html' : html `
290
292
<head>
@@ -295,7 +297,9 @@ describe.each([
295
297
</body>
296
298
` ,
297
299
'project-a/tailwind.config.js' : js `
298
- export default { content: ['../project-b/src/**/*.js'] }
300
+ export default {
301
+ content: ['../project-b/src/**/*.js'],
302
+ }
299
303
` ,
300
304
'project-a/src/index.css' : css `
301
305
@import 'tailwindcss/theme' theme(reference);
@@ -320,7 +324,9 @@ describe.each([
320
324
} ,
321
325
} ,
322
326
async ( { root, spawn, fs, expect } ) => {
323
- let process = await spawn ( 'pnpm vite build --watch' , { cwd : path . join ( root , 'project-a' ) } )
327
+ let process = await spawn ( 'pnpm vite build --watch' , {
328
+ cwd : path . join ( root , 'project-a' ) ,
329
+ } )
324
330
await process . onStdout ( ( m ) => m . includes ( 'built in' ) )
325
331
326
332
let filename = ''
@@ -459,7 +465,7 @@ describe.each([
459
465
export default defineConfig({
460
466
css: ${ transformer === 'postcss' ? '{}' : "{ transformer: 'lightningcss' }" } ,
461
467
build: { cssMinify: false },
462
- plugins: [tailwindcss({ scanner: ' ${ scanner } ' } )],
468
+ plugins: [tailwindcss()],
463
469
})
464
470
` ,
465
471
'project-a/index.html' : html `
@@ -545,7 +551,7 @@ describe.each([
545
551
export default defineConfig({
546
552
css: ${ transformer === 'postcss' ? '{}' : "{ transformer: 'lightningcss' }" } ,
547
553
build: { cssMinify: false },
548
- plugins: [tailwindcss({ scanner: ' ${ scanner } ' } )],
554
+ plugins: [tailwindcss()],
549
555
})
550
556
` ,
551
557
'project-a/index.html' : html `
@@ -647,7 +653,7 @@ describe.each([
647
653
export default defineConfig({
648
654
css: ${ transformer === 'postcss' ? '{}' : "{ transformer: 'lightningcss' }" } ,
649
655
build: { cssMinify: false },
650
- plugins: [tailwindcss({ scanner: ' ${ scanner } ' } )],
656
+ plugins: [tailwindcss()],
651
657
})
652
658
` ,
653
659
'project-a/index.html' : html `
@@ -696,15 +702,23 @@ test(
696
702
'package.json' : json `
697
703
{
698
704
"type": "module",
699
- "dependencies": { "@tailwindcss/vite": "workspace:^", "tailwindcss": "workspace:^" },
700
- "devDependencies": { "vite": "^6" }
705
+ "dependencies": {
706
+ "@tailwindcss/vite": "workspace:^",
707
+ "tailwindcss": "workspace:^"
708
+ },
709
+ "devDependencies": {
710
+ "vite": "^6"
711
+ }
701
712
}
702
713
` ,
703
714
'vite.config.ts' : ts `
704
715
import tailwindcss from '@tailwindcss/vite'
705
716
import { defineConfig } from 'vite'
706
717
707
- export default defineConfig({ build: { cssMinify: false }, plugins: [tailwindcss()] })
718
+ export default defineConfig({
719
+ build: { cssMinify: false },
720
+ plugins: [tailwindcss()],
721
+ })
708
722
` ,
709
723
'index.html' : html `
710
724
<head>
@@ -770,15 +784,23 @@ test(
770
784
'package.json' : json `
771
785
{
772
786
"type": "module",
773
- "dependencies": { "@tailwindcss/vite": "workspace:^", "tailwindcss": "workspace:^" },
774
- "devDependencies": { "vite": "^6" }
787
+ "dependencies": {
788
+ "@tailwindcss/vite": "workspace:^",
789
+ "tailwindcss": "workspace:^"
790
+ },
791
+ "devDependencies": {
792
+ "vite": "^6"
793
+ }
775
794
}
776
795
` ,
777
796
'vite.config.ts' : ts `
778
797
import tailwindcss from '@tailwindcss/vite'
779
798
import { defineConfig } from 'vite'
780
799
781
- export default defineConfig({ build: { cssMinify: false }, plugins: [tailwindcss()] })
800
+ export default defineConfig({
801
+ build: { cssMinify: false },
802
+ plugins: [tailwindcss()],
803
+ })
782
804
` ,
783
805
'index.html' : html `
784
806
<head>
@@ -838,7 +860,10 @@ test(
838
860
import tailwindcss from '@tailwindcss/vite'
839
861
import { defineConfig } from 'vite'
840
862
841
- export default defineConfig({ build: { cssMinify: false }, plugins: [tailwindcss()] })
863
+ export default defineConfig({
864
+ build: { cssMinify: false },
865
+ plugins: [tailwindcss()],
866
+ })
842
867
` ,
843
868
'index.html' : html `
844
869
<head>
0 commit comments