diff --git a/packages/tailwindcss-language-server/src/util/getModuleDependencies.ts b/packages/tailwindcss-language-server/src/util/getModuleDependencies.ts index 09080431ea1694618e7156db1c1ab9c2de616e65..fc0ae8cfa993e6c178fbec633698627d591b82e5 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/bac5ecf0040aa9a788d1b22d706506146ee831ff/src/lib/getModuleDependencies.js +// https://github.com/tailwindlabs/tailwindcss/blob/e046a37dbc17f163b066cd34a559e7c8a276bd8b/src/lib/getModuleDependencies.js import fs from 'fs' import path from 'path' import normalizePath from 'normalize-path' @@ -42,11 +42,12 @@ function* _getModuleDependencies( filename: string, base: string, - seen: Set, + seen: Set import path from 'path' - +let jsExtensions = ['.js', '.cjs', '.mjs'] -import path from 'path' let jsExtensions = ['.js', '.cjs', '.mjs'] +// `b.ts` before `b.js` + // Try to find the file let absoluteFile = resolveWithExtension( path.resolve(base, filename), @@ -64,7 +65,6 @@ // Resolve new base for new imports/requires base = path.dirname(absoluteFile) - let contents = fs.readFileSync(absoluteFile, 'utf-8') // Find imports/requires @@ -76,6 +77,7 @@ // Bail out if it's not a relative file if (!match[1].startsWith('.')) continue let jsExtensions = ['.js', '.cjs', '.mjs'] +// } }