Skip to content

Commit 4d4d20e

Browse files
Support directory imports for index.{ts,cts,mts} (#1198)
Fixes #1196
1 parent 718a669 commit 4d4d20e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/tailwindcss-language-server/src/resolver/index.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,16 @@ export async function createResolver(opts: ResolverOptions): Promise<Resolver> {
143143

144144
let esmResolver = ResolverFactory.createResolver({
145145
fileSystem,
146-
extensions: ['.mjs', '.js'],
146+
// .json is omitted since Node does not support await import('foo.json')
147+
extensions: ['.mjs', '.js', '.node', '.mts', '.ts'],
147148
mainFields: ['module'],
148149
conditionNames: ['node', 'import'],
149150
pnpApi,
150151
})
151152

152153
let cjsResolver = ResolverFactory.createResolver({
153154
fileSystem,
154-
extensions: ['.cjs', '.js'],
155+
extensions: ['.cjs', '.js', '.json', '.node', '.cts', '.ts'],
155156
mainFields: ['main'],
156157
conditionNames: ['node', 'require'],
157158
pnpApi,

packages/vscode-tailwindcss/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- Better handle really long class lists in attributes and custom regexes ([#1192](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1192))
1515
- Add support for Astro’s template literal attributes ([#1193](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1193))
1616
- Match custom class regex in Vue templates ([#1194](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1194))
17+
- Support directory imports in plugins for `index.{ts,cts,mts}` ([#1198](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1198))
1718

1819
## 0.14.3
1920

0 commit comments

Comments
 (0)