Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pick up changes from files that are both context and content deps #9787

Merged
merged 3 commits into from Nov 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- Fixed use of `raw` content in the CLI ([#9773](https://github.com/tailwindlabs/tailwindcss/pull/9773))
- Pick up changes from files that are both context and content deps ([#9787](https://github.com/tailwindlabs/tailwindcss/pull/9787))

## [3.2.2] - 2022-11-04

Expand Down
9 changes: 8 additions & 1 deletion src/lib/content.js
Expand Up @@ -196,7 +196,14 @@ function resolveChangedFiles(candidateFiles, fileModifiedMap) {
let prevModified = fileModifiedMap.has(file) ? fileModifiedMap.get(file) : -Infinity
let modified = fs.statSync(file).mtimeMs

if (modified > prevModified) {
// This check is intentionally >= because we track the last modified time of context dependencies
// earier in the process and we want to make sure we don't miss any changes that happen
// when a context dependency is also a content dependency
// Ideally, we'd do all this tracking at one time but that is a larger refactor
// than we want to commit to right now, so this is a decent compromise.
// This should be sufficient because file modification times will be off by at least
// 1ms (the precision of fstat in Node) in most cases if they exist and were changed.
if (modified >= prevModified) {
changedFiles.add(file)
fileModifiedMap.set(file, modified)
}
Expand Down