From 9605473af45be47fa3e276f4349c683be5c804da Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Wed, 9 Nov 2022 10:16:29 -0500 Subject: [PATCH 1/3] Pick up changes from files that are both context and content deps We switched to absolute paths and it broke this revealing a lurking bug. Fun. --- src/lib/content.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/content.js b/src/lib/content.js index c486a6886374..0f89913d27f7 100644 --- a/src/lib/content.js +++ b/src/lib/content.js @@ -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) } From 79b62beeb6d7ef9d76a78ff79d5c9687cb292268 Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Wed, 9 Nov 2022 10:17:02 -0500 Subject: [PATCH 2/3] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ddecbb34ff9..f4f53d62fc0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 ([#9777](https://github.com/tailwindlabs/tailwindcss/pull/9777)) ## [3.2.2] - 2022-11-04 From 1890c15bb3cc14fbb9ab4fd1491e84016c5beacc Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Wed, 9 Nov 2022 10:18:19 -0500 Subject: [PATCH 3/3] Update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4f53d62fc0c..d6ef24b4883a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +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 ([#9777](https://github.com/tailwindlabs/tailwindcss/pull/9777)) +- 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