@@ -285,18 +285,33 @@ describe.only('@source', () => {
285
285
/* {my-lib-1,my-lib-2}: expand */
286
286
/* *.html: only look for .html */
287
287
@source '../node_modules/{my-lib-1,my-lib-2}/src/**/*.html';
288
- @source './logo.{jpg,png}'; /* Don't worry about it */
288
+
289
+ /* We typically ignore these extensions, but now include them explicitly */
290
+ @source './logo.{jpg,png}';
291
+
292
+ /* Project C should apply auto source detection */
293
+ @source '../../project-c';
289
294
` ,
295
+
296
+ // Project A is the current folder, but we explicitly configured
297
+ // `source(project-b)`, therefore project-a should not be included in
298
+ // the output.
290
299
'project-a/src/index.html' : html `
291
300
< div
292
301
class ="content-['SHOULD-NOT-EXIST-IN-OUTPUT'] content-['project-a/src/index.html'] "
293
302
> </ div >
294
303
` ,
304
+
305
+ // Project A explicitly includes an extension we usually ignore,
306
+ // therefore it should be included in the output.
295
307
'project-a/src/logo.jpg' : html `
296
308
< div
297
309
class ="content-['project-a/src/logo.jpg'] "
298
310
> </ div >
299
311
` ,
312
+
313
+ // Project A explicitly includes node_modules/{my-lib-1,my-lib-2},
314
+ // therefore these files should be included in the output.
300
315
'project-a/node_modules/my-lib-1/src/index.html' : html `
301
316
< div
302
317
class ="content-['project-a/node_modules/my-lib-1/src/index.html'] "
@@ -307,22 +322,55 @@ describe.only('@source', () => {
307
322
class ="content-['project-a/node_modules/my-lib-2/src/index.html'] "
308
323
> </ div >
309
324
` ,
325
+
326
+ // Project B is the configured `source(…)`, therefore auto source
327
+ // detection should include known extensions and folders in the output.
310
328
'project-b/src/index.html' : html `
311
329
< div
312
330
class ="content-['project-b/src/index.html'] "
313
331
> </ div >
314
332
` ,
333
+
334
+ // Project B is the configured `source(…)`, therefore auto source
335
+ // detection should apply and node_modules should not be included in the
336
+ // output.
315
337
'project-b/node_modules/my-lib-3/src/index.html' : html `
316
338
< div
317
339
class ="content-['SHOULD-NOT-EXIST-IN-OUTPUT'] content-['project-b/node_modules/my-lib-3/src/index.html'] "
318
340
> </ div >
319
341
` ,
342
+
343
+ // Project C should apply auto source detection, therefore known
344
+ // extensions and folders should be included in the output.
345
+ 'project-c/src/index.html' : html `
346
+ < div
347
+ class ="content-['project-c/src/index.html'] "
348
+ > </ div >
349
+ ` ,
350
+
351
+ // Project C should apply auto source detection, therefore known ignored
352
+ // extensions should not be included in the output.
353
+ 'project-c/src/logo.jpg' : html `
354
+ < div
355
+ class ="content-['SHOULD-NOT-EXIST-IN-OUTPUT'] content-['project-c/src/logo.jpg'] "
356
+ > </ div >
357
+ ` ,
358
+
359
+ // Project C should apply auto source detection, therefore node_modules
360
+ // should not be included in the output.
361
+ 'project-c/node_modules/my-lib-1/src/index.html' : html `
362
+ < div
363
+ class ="content-['SHOULD-NOT-EXIST-IN-OUTPUT'] content-['project-c/node_modules/my-lib-1/src/index.html'] "
364
+ > </ div >
365
+ ` ,
320
366
} ,
321
367
} ,
322
368
async ( { fs, exec, root } ) => {
323
- await exec ( 'pnpm tailwindcss --input src/index.css --output dist/out.css' , {
324
- cwd : path . join ( root , 'project-a' ) ,
325
- } )
369
+ console . log (
370
+ await exec ( 'pnpm tailwindcss --input src/index.css --output dist/out.css' , {
371
+ cwd : path . join ( root , 'project-a' ) ,
372
+ } ) ,
373
+ )
326
374
327
375
expect ( await fs . dumpFiles ( './project-a/dist/*.css' ) ) . toMatchInlineSnapshot ( `
328
376
"
@@ -344,6 +392,10 @@ describe.only('@source', () => {
344
392
--tw-content: 'project-b/src/index.html';
345
393
content: var(--tw-content);
346
394
}
395
+ .content-\\[\\'project-c\\/src\\/index\\.html\\'\\] {
396
+ --tw-content: 'project-c/src/index.html';
397
+ content: var(--tw-content);
398
+ }
347
399
}
348
400
@supports (-moz-orient: inline) {
349
401
@layer base {
0 commit comments