Skip to content

fix: include types in package.json exports#321

Merged
hannoeru merged 1 commit intowindicss:mainfrom
joelmukuthu:fix/types-in-exports
Aug 12, 2023
Merged

fix: include types in package.json exports#321
hannoeru merged 1 commit intowindicss:mainfrom
joelmukuthu:fix/types-in-exports

Conversation

@joelmukuthu
Copy link
Contributor

This fixes this typescript error, when one tries to import windiCSS from 'vite-plugin-windicss';:

Could not find a declaration file for module 'vite-plugin-windicss'. 
  '/project/node_modules/vite-plugin-windicss/dist/index.mjs' implicitly has an 'any' type.
  There are types at '/project/node_modules/vite-plugin-windicss/dist/index.d.ts', but this 
  result could not be resolved when respecting package.json "exports". 
  The 'vite-plugin-windicss' library may need to update its package.json or typings.ts(7016)

This happens with vite-plugin-windicss v1.9.0, typescript v5.1.6 and the moduleResolution tsconfig compiler-option set to bundler, which per my understanding makes typescript import stuff only from what's defined in a module's exports.

@hannoeru hannoeru merged commit 64771a3 into windicss:main Aug 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants