Skip to content

Commit 8e85a86

Browse files
authored
Ensure module dependencies for value null, is an empty Set (#10877)
* 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. * update changelog
1 parent 5b77b42 commit 8e85a86

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2929
- Disallow multiple selectors in arbitrary variants ([#10655](https://github.com/tailwindlabs/tailwindcss/pull/10655))
3030
- Sort class lists deterministically for Prettier plugin ([#10672](https://github.com/tailwindlabs/tailwindcss/pull/10672))
3131
- Ensure CLI builds have a non-zero exit code on failure ([#10703](https://github.com/tailwindlabs/tailwindcss/pull/10703))
32+
- Ensure module dependencies for value `null`, is an empty `Set` ([#10877](https://github.com/tailwindlabs/tailwindcss/pull/10877))
3233

3334
### Changed
3435

src/lib/getModuleDependencies.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ function* _getModuleDependencies(filename, base, seen, ext = path.extname(filena
7272
}
7373

7474
export default function getModuleDependencies(absoluteFilePath) {
75+
if (absoluteFilePath === null) return new Set()
7576
return new Set(
7677
_getModuleDependencies(absoluteFilePath, path.dirname(absoluteFilePath), new Set())
7778
)

0 commit comments

Comments
 (0)