Skip to content

Commit 89f8dcb

Browse files
authored
docs: write about debugging the plugin (#43)
1 parent 1529e47 commit 89f8dcb

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,38 @@ export default {
139139

140140
Note that `picomatch` patterns are very similar to [`minimatch`](https://github.com/isaacs/minimatch#readme) patterns, and in most use cases, they are interchangeable. If you have more specific pattern matching needs, you can view [this comparison table](https://github.com/micromatch/picomatch#library-comparisons) to learn more about where the libraries differ.
141141

142+
## Debugging
143+
144+
Use `DEBUG='rsbuild'` to enable debugging mode for the plugin. When debugging is enabled, the plugin will:
145+
146+
1. Save the generated Tailwind CSS configuration files in the `.rsbuild/<entry-name>` directory inside your project's output path.
147+
2. Generate readable configuration files that include all modules being processed by Tailwind CSS.
148+
149+
This is helpful for:
150+
151+
- Inspecting which modules are included in the Tailwind CSS content scanning
152+
- Troubleshooting issues with CSS purging
153+
- Understanding how the plugin is generating configurations for each entry point
154+
155+
Example:
156+
157+
```bash
158+
# For macOS/Linux
159+
DEBUG=rsbuild npm run build
160+
161+
# For Windows (cmd)
162+
set DEBUG=rsbuild && npm run build
163+
164+
# For Windows (PowerShell)
165+
$env:DEBUG="rsbuild"; npm run build
166+
```
167+
168+
You can also use more specific debug patterns:
169+
170+
- `DEBUG=rsbuild:tailwind` - Debug only the Tailwind CSS plugin
171+
- `DEBUG=rsbuild:*` - Debug all Rsbuild plugins
172+
- `DEBUG=*` - Debug everything
173+
142174
## Credits
143175

144176
Thanks to:

0 commit comments

Comments
 (0)