Skip to content

Fix docs type-checking for the Tailwind plugin#29

Merged
skirtles-code merged 1 commit into
mainfrom
tailwind-plugin-type
Apr 27, 2026
Merged

Fix docs type-checking for the Tailwind plugin#29
skirtles-code merged 1 commit into
mainfrom
tailwind-plugin-type

Conversation

@skirtles-code
Copy link
Copy Markdown
Owner

Type checking the docs package currently fails when Tailwind is included.

The underlying problem appears to be the Vite version. VitePress is still using Vite 5, whereas everything else is using Vite 7. The return value for the Tailwind plugin is Plugin, with import { Plugin } from 'vite', but that is currently resolving from Vite 7, which doesn't match the Vite 5 Plugin type needed by the VitePress config.

Tailwind itself is compatible with Vite 5.2.0+.

The solution is to make Vite an explicit dependency in the package.json for the docs package. This leads to pnpm installing two copies of Tailwind in node_modules, one for Vite 7 and one for Vite 5. Tailwind itself is the same in both cases, but the nested node_modules contains different version of Vite, allowing the types to resolve correctly.

This should benefit any other plugins that rely on Vite's Plugin type too.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 23, 2026

Open in StackBlitz

pnpm dlx https://pkg.pr.new/@skirtle/create-vue-lib@29

commit: 2597ff5

@skirtles-code skirtles-code merged commit 5b6c15e into main Apr 27, 2026
3 checks passed
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.

1 participant