Skip to content

Commit 7dcf79e

Browse files
committed
Link stylesheet deps to existing graph entries
1 parent 59be3bd commit 7dcf79e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/tailwindcss-language-server/src/project-locator.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,11 @@ export class ProjectLocator {
345345
// Resolve all @source directives
346346
await Promise.all(imports.map((file) => file.resolveSourceDirectives()))
347347

348+
// Link every entry in the import graph
349+
let byRealPath: Record<string, FileEntry> = {}
350+
for (let file of imports) byRealPath[file.realpath] = file
351+
for (let file of imports) file.deps = file.deps.map((dep) => byRealPath[dep.realpath] ?? dep)
352+
348353
// Create a graph of all the CSS files that might (indirectly) use Tailwind
349354
let graph = new Graph<FileEntry>()
350355

0 commit comments

Comments
 (0)