Skip to content

Commit 0efcdd7

Browse files
authored
Support node: module prefix (tailwindlabs#585)
1 parent d298014 commit 0efcdd7

File tree

1 file changed

+4
-1
lines changed
  • packages/tailwindcss-language-server/src/lib

1 file changed

+4
-1
lines changed

packages/tailwindcss-language-server/src/lib/env.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ process.env.TAILWIND_DISABLE_TOUCH = 'true'
99
let oldResolveFilename = (Module as any)._resolveFilename
1010

1111
;(Module as any)._resolveFilename = (id: any, parent: any) => {
12-
if (builtInModules.includes(id)) {
12+
if (
13+
typeof id === 'string' &&
14+
(builtInModules.includes(id) || builtInModules.includes(id.replace(/^node:/, '')))
15+
) {
1316
return oldResolveFilename(id, parent)
1417
}
1518
return resolveFrom(path.dirname(parent.id), id)

0 commit comments

Comments
 (0)