docs(vite): add TypeScript configuration example to README
This commit is contained in:
parent
fd60994b5a
commit
823d99541b
1 changed files with 18 additions and 0 deletions
|
|
@ -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)],
|
||||
})
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue