mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Ignore content files that don't exist (#6901)
* ignore content files that don't exist PostCSS CLI will give you a fake file path that ends in /stdin if you are reading from stdin. * update changelog
This commit is contained in:
parent
78fb761d75
commit
5f49e53aba
@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
### Fixed
|
||||
|
||||
- Preserve case of css variables added by plugins ([#6888](https://github.com/tailwindlabs/tailwindcss/pull/6888))
|
||||
- Ignore content files that don't exist ([#6901](https://github.com/tailwindlabs/tailwindcss/pull/6901))
|
||||
|
||||
## [3.0.10] - 2022-01-04
|
||||
|
||||
|
||||
@ -435,7 +435,14 @@ function trackModified(files, fileModifiedMap) {
|
||||
let parsed = url.parse(file)
|
||||
let pathname = parsed.hash ? parsed.href.replace(parsed.hash, '') : parsed.href
|
||||
pathname = parsed.search ? pathname.replace(parsed.search, '') : pathname
|
||||
let newModified = fs.statSync(decodeURIComponent(pathname)).mtimeMs
|
||||
let newModified = fs.statSync(decodeURIComponent(pathname), { throwIfNoEntry: false })?.mtimeMs
|
||||
if (!newModified) {
|
||||
// It could happen that a file is passed in that doesn't exist. E.g.:
|
||||
// postcss-cli will provide you a fake path when reading from stdin. This
|
||||
// path then looks like /path-to-your-project/stdin In that case we just
|
||||
// want to ignore it and don't track changes at all.
|
||||
continue
|
||||
}
|
||||
|
||||
if (!fileModifiedMap.has(file) || newModified > fileModifiedMap.get(file)) {
|
||||
changed = true
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user