From d11b523a9a9832348c60735562574edcc77ae810 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Mon, 27 Mar 2023 18:51:36 +0200 Subject: [PATCH 1/2] ensure we have no dependencies when `absoluteFilePath` is `null` This happens in the CLI where we don't have a guaranteed `path` for the config file. This can happen in practice if you use: ```console npx tailwindcss --content ./index.html -o ./output.css ``` ... and if you don't have a `tailwind.config.{js,ts,cjs,...}` in the current directory. --- src/lib/getModuleDependencies.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/getModuleDependencies.js b/src/lib/getModuleDependencies.js index 43b39193f5da..bd27022f29c7 100644 --- a/src/lib/getModuleDependencies.js +++ b/src/lib/getModuleDependencies.js @@ -72,6 +72,7 @@ function* _getModuleDependencies(filename, base, seen, ext = path.extname(filena } export default function getModuleDependencies(absoluteFilePath) { + if (absoluteFilePath === null) return new Set() return new Set( _getModuleDependencies(absoluteFilePath, path.dirname(absoluteFilePath), new Set()) ) From 31de94f6867b8f95ddd30e1e72745e88785a5dec Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Mon, 27 Mar 2023 19:00:13 +0200 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e8e81ee99db..62e9d5265a09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Disallow multiple selectors in arbitrary variants ([#10655](https://github.com/tailwindlabs/tailwindcss/pull/10655)) - Sort class lists deterministically for Prettier plugin ([#10672](https://github.com/tailwindlabs/tailwindcss/pull/10672)) - Ensure CLI builds have a non-zero exit code on failure ([#10703](https://github.com/tailwindlabs/tailwindcss/pull/10703)) +- Ensure module dependencies for value `null`, is an empty `Set` ([#10877](https://github.com/tailwindlabs/tailwindcss/pull/10877)) ### Changed