Skip to content

Commit f36a704

Browse files
committed
ensure the root CSS file part of the cssImportPaths
1 parent fa665e0 commit f36a704

File tree

1 file changed

+6
-2
lines changed
  • packages/@tailwindcss-cli/src/commands/build

1 file changed

+6
-2
lines changed

packages/@tailwindcss-cli/src/commands/build/index.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,9 @@ function handleImports(
244244
// Relevant specification:
245245
// - CSS Import Resolve: https://csstools.github.io/css-import-resolve/
246246

247-
if (!input.includes('@import')) return [input, []]
247+
if (!input.includes('@import')) {
248+
return [input, [file]]
249+
}
248250

249251
return postcss()
250252
.use(atImport())
@@ -254,6 +256,8 @@ function handleImports(
254256

255257
// Use `result.messages` to get the imported files. This also includes the
256258
// current file itself.
257-
result.messages.filter((msg) => msg.type === 'postcss-import').map((msg) => msg.file),
259+
[file].concat(
260+
result.messages.filter((msg) => msg.type === 'dependency').map((msg) => msg.file),
261+
),
258262
])
259263
}

0 commit comments

Comments
 (0)