You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/content/en/patch.mdx
+22-22Lines changed: 22 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,17 +2,17 @@ import { Callout } from 'nextra/components'
2
2
3
3
# 1. Patch
4
4
5
-
`tailwindcss-patch` is the first step of the mangling workflow. Version 8.0 refactors the package so you can capture runtime contexts, enumerate every Tailwind CSS class, and keep the results in sync with modern projects.
5
+
`tailwindcss-patch` is the first step of the mangling workflow. Version 9 focuses on a modern-only configuration model so you can capture runtime contexts, enumerate every Tailwind CSS class, and keep the results in sync with modern projects.
6
6
7
7
## Tailwindcss-Patch 8.0 at a glance
8
8
9
9
- Re-architected modules (`api/`, `patching/`, `runtime/`, `extraction/`, `cache/`) with typed entry points for direct imports.
10
-
- Unified `registry` configuration that normalises legacy `patch`/`cache` configs and unlocks cache, output, and feature flags in one place.
10
+
- Unified `registry` configuration with explicit `extract`, `apply`, and `tailwindcss` blocks.
11
11
- First-class Tailwind CSS v4 support by scanning CSS entry files and project sources alongside the existing v2/v3 runtime patch.
12
12
- Refreshed CLI with clearer logging plus new `extract` flags (`--output`, `--format`, `--css`, `--no-write`) for automation.
13
13
14
14
<Callouttype="info">
15
-
Need upgrade guidance? See the <ahref="./migration">migration guide</a> for a step-by-step checklist from v7.x.
15
+
Need upgrade guidance? See the <ahref="./patch-v9-migration">v8 -> v9 patch migration guide</a>.
16
16
</Callout>
17
17
18
18
## Installation
@@ -62,7 +62,7 @@ By default `extract` writes `.tw-patch/tw-class-list.json`. Customise the destin
62
62
|`--css <file>`| Provide CSS entry files used by Tailwind v4 builds. Repeat for multiple files. |
63
63
|`--no-write`| Skip writing to disk and return the class list to the caller. |
64
64
65
-
The CLI reads `tailwindcss-patch.config.ts`(or legacy `tailwindcss-mangle.config.ts`) through `@tailwindcss-mangle/config`, so existing configs remain valid.
65
+
The CLI reads `tailwindcss-patch.config.ts` through `@tailwindcss-mangle/config`. v9 expects the modern `registry` shape.
66
66
67
67
## Configuration
68
68
@@ -79,23 +79,23 @@ import { defineConfig } from 'tailwindcss-patch'
`defineConfig`still accepts legacy `patch` / `mangle` fields, converting them to the new`registry` / `transformer` shape so you can migrate at your own pace. Newly added fields are normalised automatically at runtime.
107
+
`defineConfig`in v9 describes the modern `registry` shape only. Legacy aliases such as`registry.output` and `registry.tailwind` should be migrated before upgrading.
108
108
109
109
## Programmatic API
110
110
111
-
The modern constructor accepts the unified options object. Legacy objects with `patch`/`cache` keys are still converted internally.
111
+
The constructor accepts the modern options object only.
0 commit comments