From ce0bb58124a5317eb5a50c0a6db3394ad0826615 Mon Sep 17 00:00:00 2001 From: abdelrhmanahmed Date: Sun, 27 Sep 2026 01:53:44 +0300 Subject: [PATCH 1/5] types(vite): add JSDoc documentation and examples to Vite PluginOptions --- packages/@tailwindcss-vite/src/index.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/@tailwindcss-vite/src/index.ts b/packages/@tailwindcss-vite/src/index.ts index 8fc660eaac18..c09ccfe8038a 100644 --- a/packages/@tailwindcss-vite/src/index.ts +++ b/packages/@tailwindcss-vite/src/index.ts @@ -22,6 +22,22 @@ const INLINE_STYLE_ID_RE = /[?&]index=\d+\.css$/ export type PluginOptions = { /** * Optimize and minify the output CSS. + * + * @default true in production build, false in development + * + * @example + * ```ts + * import tailwindcss from '@tailwindcss/vite' + * import { defineConfig } from 'vite' + * + * export default defineConfig({ + * plugins: [ + * tailwindcss({ + * optimize: { minify: true }, + * }), + * ], + * }) + * ``` */ optimize?: boolean | { minify?: boolean } } From 5c88d71ef932cdd78c1fd63ea19a5620b5f79d5a Mon Sep 17 00:00:00 2001 From: abdelrhmanahmed Date: Sun, 27 Sep 2026 01:56:34 +0300 Subject: [PATCH 2/5] types(postcss): enhance PostCSS PluginOptions with default tags and configuration examples --- packages/@tailwindcss-postcss/src/index.ts | 39 ++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/packages/@tailwindcss-postcss/src/index.ts b/packages/@tailwindcss-postcss/src/index.ts index a4a8d93268ae..c71ff21c955b 100644 --- a/packages/@tailwindcss-postcss/src/index.ts +++ b/packages/@tailwindcss-postcss/src/index.ts @@ -53,19 +53,54 @@ export type PluginOptions = { /** * The base directory to scan for class candidates. * - * Defaults to the current working directory. + * @default process.cwd() + * + * @example + * ```js + * export default { + * plugins: { + * '@tailwindcss/postcss': { + * base: './src', + * }, + * }, + * } + * ``` */ base?: string /** * Optimize and minify the output CSS. + * + * @default true in production, false in development + * + * @example + * ```js + * export default { + * plugins: { + * '@tailwindcss/postcss': { + * optimize: { minify: true }, + * }, + * }, + * } + * ``` */ optimize?: boolean | { minify?: boolean } /** * Enable or disable asset URL rewriting. * - * Defaults to `true`. + * @default true + * + * @example + * ```js + * export default { + * plugins: { + * '@tailwindcss/postcss': { + * transformAssetUrls: false, + * }, + * }, + * } + * ``` */ transformAssetUrls?: boolean } From 864b06b14f4e0938d9a1f7cf8cab86faad23d481 Mon Sep 17 00:00:00 2001 From: abdelrhmanahmed Date: Sun, 27 Sep 2026 02:07:27 +0300 Subject: [PATCH 3/5] types(plugins): export explicit named tailwindcss plugin in Vite and PostCSS entrypoints --- packages/@tailwindcss-postcss/src/index.ts | 1 + packages/@tailwindcss-vite/src/index.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/packages/@tailwindcss-postcss/src/index.ts b/packages/@tailwindcss-postcss/src/index.ts index c71ff21c955b..961710c798d2 100644 --- a/packages/@tailwindcss-postcss/src/index.ts +++ b/packages/@tailwindcss-postcss/src/index.ts @@ -410,3 +410,4 @@ function tailwindcss(opts: PluginOptions = {}): AcceptedPlugin { } export default Object.assign(tailwindcss, { postcss: true }) as PluginCreator +export { tailwindcss } diff --git a/packages/@tailwindcss-vite/src/index.ts b/packages/@tailwindcss-vite/src/index.ts index c09ccfe8038a..0824974d23b1 100644 --- a/packages/@tailwindcss-vite/src/index.ts +++ b/packages/@tailwindcss-vite/src/index.ts @@ -557,3 +557,5 @@ class Root { return false } } + +export { tailwindcss } From fd60994b5a3f7c1c295b5a7883b74ef2377b13f0 Mon Sep 17 00:00:00 2001 From: abdelrhmanahmed Date: Sun, 27 Sep 2026 02:09:39 +0300 Subject: [PATCH 4/5] docs(plugins): document bundler plugin type options and configuration details in changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5e6f6f89805..8881cecf51e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Add `@tailwindcss/turbopack` package to run Tailwind CSS with Next.js ([20367](https://github.com/tailwindlabs/tailwindcss/pull/20367)) +- Enhance TypeScript `PluginOptions` types with JSDoc documentation, default tags, and examples for `@tailwindcss/vite` and `@tailwindcss/postcss` ### Fixed From 823d99541b313d90ad59ae0f5a13a010753885fc Mon Sep 17 00:00:00 2001 From: abdelrhmanahmed Date: Sun, 27 Sep 2026 02:10:42 +0300 Subject: [PATCH 5/5] docs(vite): add TypeScript configuration example to README --- packages/@tailwindcss-vite/README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/@tailwindcss-vite/README.md b/packages/@tailwindcss-vite/README.md index 1a5d25c73652..d4de5a24df7e 100644 --- a/packages/@tailwindcss-vite/README.md +++ b/packages/@tailwindcss-vite/README.md @@ -74,3 +74,21 @@ export default defineConfig({ ], }) ``` + +### TypeScript Usage + +When configuring Vite in TypeScript, `@tailwindcss/vite` provides both default and named exports, along with the `PluginOptions` type definition: + +```ts +import tailwindcss, { type PluginOptions } from '@tailwindcss/vite' +import { defineConfig } from 'vite' + +const options: PluginOptions = { + optimize: { minify: true }, +} + +export default defineConfig({ + plugins: [tailwindcss(options)], +}) +``` +