tailwindcss/integrations/postcss
Philipp Spiess 35cd2ff1ee
Resolve third-party plugins with exports in their package.json (#14775)
This PR fixes an issue when trying to resolve plugins with `exports` in
their `package.json`, like `@headlessui/tailwindcss`. The missing
`conditionNames` in the enhanced resolver config would cause it to not
properly look up the name.

## Test Plan

I added a test using the `postcss` setup (the existing plugin tests are
inside the CLI setup but the CLI can only ever run in Module JS mode).

To ensure the tests are resolving to the right environment (CJS vs MJS),
I added logging of the `import.meta.url` value to the resolver code.
When run, this was the output:

![Screenshot 2024-10-24 at
15.28.10.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/0Y77ilPI2WoJfMLFiAEw/c0197934-7b61-47c4-bda5-de037b31d43a.png)

Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
2024-10-24 11:34:19 -04:00
..
config.test.ts Support loading config files via @config (#14239) 2024-09-02 18:03:16 +02:00
core-as-postcss-plugin.test.ts Throw a useful error when tailwindcss is used as a PostCSS plugin (#14378) 2024-09-11 17:02:24 +02:00
index.test.ts Improve @tailwindcss/postcss performance for initial builds (#14565) 2024-10-03 16:21:54 +02:00
multi-root.test.ts Add integration tests for multi-root builds (#14564) 2024-10-01 17:00:20 +02:00
next.test.ts Integration tests: Move all file writes into retry block (#14350) 2024-09-06 10:48:49 +02:00
plugins.test.ts Resolve third-party plugins with exports in their package.json (#14775) 2024-10-24 11:34:19 -04:00