File tree 2 files changed +13
-1
lines changed
tailwindcss-language-server/src/lib
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 1
1
import Module from 'node:module'
2
- import { isBuiltin } from 'node:module'
3
2
import * as path from 'node:path'
4
3
import resolveFrom from '../util/resolveFrom'
5
4
@@ -8,6 +7,18 @@ process.env.TAILWIND_DISABLE_TOUCH = 'true'
8
7
9
8
let oldResolveFilename = ( Module as any ) . _resolveFilename
10
9
10
+ function isBuiltin ( id : string ) {
11
+ // Node 16.17+, v18.6.0+, >= v20
12
+ // VSCode >= 1.78
13
+ if ( 'isBuiltin' in Module ) {
14
+ return Module . isBuiltin ( id )
15
+ }
16
+
17
+ // Older versions of Node and VSCode
18
+ // @ts -ignore
19
+ return Module . builtinModules . includes ( id . replace ( / ^ n o d e : / , '' ) )
20
+ }
21
+
11
22
; ( Module as any ) . _resolveFilename = ( id : any , parent : any ) => {
12
23
if ( typeof id === 'string' && isBuiltin ( id ) ) {
13
24
return oldResolveFilename ( id , parent )
Original file line number Diff line number Diff line change 3
3
## Prerelease
4
4
5
5
- Fix loading projects on Windows network drives ([ #996 ] ( https://github.com/tailwindlabs/tailwindcss-intellisense/pull/996 ) )
6
+ - Fix server not launching on older versions of VSCode ([ #998 ] ( https://github.com/tailwindlabs/tailwindcss-intellisense/pull/998 ) )
6
7
7
8
## 0.12.1
8
9
You can’t perform that action at this time.
0 commit comments