Skip to content

Commit

Permalink
Support directory imports for index.{ts,cts,mts} (#1198)
Browse files Browse the repository at this point in the history
Fixes #1196
  • Loading branch information
thecrypticace authored Feb 12, 2025
1 parent 718a669 commit 4d4d20e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/tailwindcss-language-server/src/resolver/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,16 @@ export async function createResolver(opts: ResolverOptions): Promise<Resolver> {

let esmResolver = ResolverFactory.createResolver({
fileSystem,
extensions: ['.mjs', '.js'],
// .json is omitted since Node does not support await import('foo.json')
extensions: ['.mjs', '.js', '.node', '.mts', '.ts'],
mainFields: ['module'],
conditionNames: ['node', 'import'],
pnpApi,
})

let cjsResolver = ResolverFactory.createResolver({
fileSystem,
extensions: ['.cjs', '.js'],
extensions: ['.cjs', '.js', '.json', '.node', '.cts', '.ts'],
mainFields: ['main'],
conditionNames: ['node', 'require'],
pnpApi,
Expand Down
1 change: 1 addition & 0 deletions packages/vscode-tailwindcss/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- Better handle really long class lists in attributes and custom regexes ([#1192](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1192))
- Add support for Astro’s template literal attributes ([#1193](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1193))
- Match custom class regex in Vue templates ([#1194](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1194))
- Support directory imports in plugins for `index.{ts,cts,mts}` ([#1198](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1198))

## 0.14.3

Expand Down

0 comments on commit 4d4d20e

Please sign in to comment.