Skip to content

Commit 94a3cff

Browse files
Fix PostCSS watcher warnings on Windows (#15321)
Resolves #15320 Resolves #15175 Turns out that the postcss file watcher does not like our Unix based paths and will print a warning about them. This fixes the issue by calling `path.resolve()` to convert it back to a Windows-style absolute path if necessary. ## Test Plan Tested on Windows with a new Next.js 14 project. Ensured that file reloads also still work (changes to the `tsx` file are picked up correctly). Also ensure that the CI runs on Windows. ### Before <img width="1178" alt="Screenshot 2024-12-06 at 13 12 23" src="https://github.com/user-attachments/assets/70c1fe45-6983-4fb4-9889-716a0cbef03a"> ### After <img width="1196" alt="Screenshot 2024-12-06 at 13 23 24" src="https://github.com/user-attachments/assets/0b9e3ff7-c5b6-4ccb-85a9-e7ba7aee355a">
1 parent 3d0b86c commit 94a3cff

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
### Fixed
1515

1616
- Ensure `@import "…" reference` never generates utilities ([#15307](https://github.com/tailwindlabs/tailwindcss/pull/15307))
17+
- Fix dependency related warnings when using `@tailwindcss/postcss` on Windows
1718

1819
## [4.0.0-beta.5] - 2024-12-04
1920

packages/@tailwindcss-postcss/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function tailwindcss(opts: PluginOptions = {}): AcceptedPlugin {
106106
result.messages.push({
107107
type: 'dependency',
108108
plugin: '@tailwindcss/postcss',
109-
file,
109+
file: path.resolve(file),
110110
parent: result.opts.from,
111111
})
112112
}
@@ -174,7 +174,7 @@ function tailwindcss(opts: PluginOptions = {}): AcceptedPlugin {
174174
result.messages.push({
175175
type: 'dependency',
176176
plugin: '@tailwindcss/postcss',
177-
file,
177+
file: path.resolve(file),
178178
parent: result.opts.from,
179179
})
180180
}
@@ -194,14 +194,14 @@ function tailwindcss(opts: PluginOptions = {}): AcceptedPlugin {
194194
result.messages.push({
195195
type: 'dependency',
196196
plugin: '@tailwindcss/postcss',
197-
file: globBase,
197+
file: path.resolve(globBase),
198198
parent: result.opts.from,
199199
})
200200
} else {
201201
result.messages.push({
202202
type: 'dir-dependency',
203203
plugin: '@tailwindcss/postcss',
204-
dir: globBase,
204+
dir: path.resolve(globBase),
205205
glob: pattern,
206206
parent: result.opts.from,
207207
})

0 commit comments

Comments
 (0)