File tree 4 files changed +29
-2
lines changed
packages/@tailwindcss-postcss/src
4 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [ Unreleased]
9
9
10
- - Nothing yet!
10
+ ### Fixed
11
+
12
+ - PostCSS: Resolve an issue where changes to the input CSS file showed outdated content when using Turbopack
11
13
12
14
## [ 4.1.2] - 2025-04-03
13
15
Original file line number Diff line number Diff line change
1
+ /* the content for this file is set in the tests */
Original file line number Diff line number Diff line change @@ -420,3 +420,25 @@ describe('concurrent builds', () => {
420
420
expect ( await promise2 ) . toContain ( '.red' )
421
421
} )
422
422
} )
423
+
424
+ test ( 'does not register the input file as a dependency, even if it is passed in as relative path' , async ( ) => {
425
+ let processor = postcss ( [
426
+ tailwindcss ( { base : `${ __dirname } /fixtures/example-project` , optimize : { minify : false } } ) ,
427
+ ] )
428
+
429
+ let result = await processor . process ( `@tailwind utilities` , { from : './input.css' } )
430
+
431
+ expect ( result . css . trim ( ) ) . toMatchInlineSnapshot ( `
432
+ ".underline {
433
+ text-decoration-line: underline;
434
+ }"
435
+ ` )
436
+
437
+ // Check for dependency messages
438
+ expect ( result . messages ) . not . toContainEqual ( {
439
+ type : 'dependency' ,
440
+ file : expect . stringMatching ( / i n p u t .c s s $ / g) ,
441
+ parent : expect . any ( String ) ,
442
+ plugin : expect . any ( String ) ,
443
+ } )
444
+ } )
Original file line number Diff line number Diff line change @@ -223,10 +223,12 @@ function tailwindcss(opts: PluginOptions = {}): AcceptedPlugin {
223
223
if ( compiler . features & Features . Utilities ) {
224
224
DEBUG && I . start ( 'Register dependency messages' )
225
225
// Add all found files as direct dependencies
226
+ // Note: With Turbopack, the input file might not be a resolved path
227
+ let resolvedInputFile = path . resolve ( base , inputFile )
226
228
for ( let file of context . scanner . files ) {
227
229
let absolutePath = path . resolve ( file )
228
230
// The CSS file cannot be a dependency of itself
229
- if ( absolutePath === result . opts . from ) {
231
+ if ( absolutePath === resolvedInputFile ) {
230
232
continue
231
233
}
232
234
result . messages . push ( {
You can’t perform that action at this time.
0 commit comments