Files
Lazizbek ErgashevandRobin Malfait 1a38f848f0 Write plugin logs to stderr in canonicalize (#20561)
## Summary

`tailwindcss canonicalize` writes its results to stdout, but the design
system is loaded in the same process, so anything a plugin logs with
`console.log` while it loads (e.g. the daisyUI banner) ends up in front
of the results. That breaks `--format json` and shifts every line in
`--stream` mode.

This points `console.log`, `console.info` and `console.debug` at
`console.error` for the `canonicalize` command, so stdout only carries
the results and plugin output goes to stderr.

Fixes #20560

## Test plan

Added an integration test with a plugin that calls `console.log`, it
fails on `main` and passes with this change.

Also checked by hand with the reproduction from the issue:

```
$ tailwindcss canonicalize --css app.css "p-4 px-2 py-2" 2>/dev/null
p-2
$ printf 'p-4 px-2 py-2\nw-4 h-4\n' | tailwindcss canonicalize --css app.css --stream 2>/dev/null
p-2
size-4
```

---------

Co-authored-by: Robin Malfait <robin.malfait@shopify.com>
2026-10-13 18:04:22 +02:00
..