Skip to content

Commit 33da72e

Browse files
committed
docs: update
1 parent 18a8c3c commit 33da72e

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

website/content/en/mangle.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,16 @@ await build({
140140
})
141141
```
142142

143+
## Framework quick start
144+
145+
| Framework | Bundler entry | Notes |
146+
| --- | --- | --- |
147+
| React (Vite) | `unplugin-tailwindcss-mangle/vite` with `@vitejs/plugin-react` | Spread `config.transformer`; Fast Refresh stays intact. |
148+
| Vue 3 (Vite) | `unplugin-tailwindcss-mangle/vite` with `@vitejs/plugin-vue` | Supports `<script setup>` and scoped styles. |
149+
| Svelte (Vite) | `unplugin-tailwindcss-mangle/vite` with `@sveltejs/vite-plugin-svelte` | Default include patterns cover `.svelte` files and co-located CSS. |
150+
| Next.js (Webpack) | `unplugin-tailwindcss-mangle/webpack` inside `next.config.{js,mjs}` | Runs during production builds; keep Tailwind extraction under `registry`. |
151+
| Nuxt 3 | `unplugin-tailwindcss-mangle/nuxt` in the `modules` array | Disable `inlineSSRStyles` so Vite emits CSS for scanning. |
152+
143153
## Plugin options
144154

145155
Configure the plugin inline or through the shared config file.

website/content/zh/mangle.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,16 @@ await build({
152152
- `preserve.functions` —— 声明包装函数(如 `twIgnore`),用于标记需要保留的模板字面量。
153153
- `disabled` —— 设为 `true` 时跳过混淆(默认在开发环境关闭)。
154154

155+
## 框架快速映射
156+
157+
| 框架 | 使用方式 | 备注 |
158+
| --- | --- | --- |
159+
| React (Vite) | `unplugin-tailwindcss-mangle/vite` + `@vitejs/plugin-react` | 展开 `config.transformer`,Fast Refresh 仍然可用。 |
160+
| Vue 3 (Vite) | `unplugin-tailwindcss-mangle/vite` + `@vitejs/plugin-vue` | 支持 `<script setup>` 与 scoped 样式。 |
161+
| Svelte (Vite) | `unplugin-tailwindcss-mangle/vite` + `@sveltejs/vite-plugin-svelte` | 默认规则覆盖 `.svelte` 与共存 CSS 文件。 |
162+
| Next.js (Webpack) | `unplugin-tailwindcss-mangle/webpack``next.config.{js,mjs}` 中调用 | 仅在生产构建执行,请在 `registry` 中维护 Tailwind 提取配置。 |
163+
| Nuxt 3 | `unplugin-tailwindcss-mangle/nuxt` 加入 `modules` | 关闭 `inlineSSRStyles`,让 Vite 输出 CSS 供扫描。 |
164+
155165
## 忽略与保留
156166

157167
使用 `preserveFunction` 可以保留某些字符串,默认内置的 `twIgnore` 可用于模板字面量:

0 commit comments

Comments
 (0)