From 0efcdd773e0b98e10e3bdf1b43550d49bb4f292d Mon Sep 17 00:00:00 2001 From: Brad Cornes Date: Mon, 25 Jul 2022 17:43:37 +0100 Subject: [PATCH] Support `node:` module prefix (#585) --- packages/tailwindcss-language-server/src/lib/env.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/tailwindcss-language-server/src/lib/env.ts b/packages/tailwindcss-language-server/src/lib/env.ts index 36f2406..d6a5389 100644 --- a/packages/tailwindcss-language-server/src/lib/env.ts +++ b/packages/tailwindcss-language-server/src/lib/env.ts @@ -9,7 +9,10 @@ process.env.TAILWIND_DISABLE_TOUCH = 'true' let oldResolveFilename = (Module as any)._resolveFilename ;(Module as any)._resolveFilename = (id: any, parent: any) => { - if (builtInModules.includes(id)) { + if ( + typeof id === 'string' && + (builtInModules.includes(id) || builtInModules.includes(id.replace(/^node:/, ''))) + ) { return oldResolveFilename(id, parent) } return resolveFrom(path.dirname(parent.id), id)