Home

tailwind-ctp-intellisense @master - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tree log patch
Fix `getModuleDependencies` https://github.com/tailwindlabs/tailwindcss/commit/439fdadb3abe9da865181f73422a19dc868cae95
Brad Cornes <hello@bradley.dev>
2 years ago
1 changed files, 5 additions(+), 5 deletions(-)
M packages/tailwindcss-language-server/src/util/getModuleDependencies.ts -> packages/tailwindcss-language-server/src/util/getModuleDependencies.ts
diff --git a/packages/tailwindcss-language-server/src/util/getModuleDependencies.ts b/packages/tailwindcss-language-server/src/util/getModuleDependencies.ts
index fc0ae8cfa993e6c178fbec633698627d591b82e5..09080431ea1694618e7156db1c1ab9c2de616e65 100644
--- a/packages/tailwindcss-language-server/src/util/getModuleDependencies.ts
+++ b/packages/tailwindcss-language-server/src/util/getModuleDependencies.ts
@@ -1,4 +1,4 @@
-// https://github.com/tailwindlabs/tailwindcss/blob/e046a37dbc17f163b066cd34a559e7c8a276bd8b/src/lib/getModuleDependencies.js
+// https://github.com/tailwindlabs/tailwindcss/blob/bac5ecf0040aa9a788d1b22d706506146ee831ff/src/lib/getModuleDependencies.js
 import fs from 'fs'
 import path from 'path'
 import normalizePath from 'normalize-path'
@@ -42,10 +42,9 @@
 function* _getModuleDependencies(
   filename: string,
   base: string,
-  seen: Set<string>
+  seen: Set<string>,
+  ext = path.extname(filename)
 ): Generator<string> {
-  let ext = path.extname(filename)
-
   // Try to find the file
   let absoluteFile = resolveWithExtension(
     path.resolve(base, filename),
@@ -62,6 +61,7 @@   yield absoluteFile
 
   // Resolve new base for new imports/requires
   base = path.dirname(absoluteFile)
+  ext = path.extname(absoluteFile)
 
   let contents = fs.readFileSync(absoluteFile, 'utf-8')
 
@@ -74,7 +74,7 @@   ]) {
     // Bail out if it's not a relative file
     if (!match[1].startsWith('.')) continue
 
-    yield* _getModuleDependencies(match[1], base, seen)
+    yield* _getModuleDependencies(match[1], base, seen, ext)
   }
 }