tailwindcss/integrations
Jordan Pittman ba55a445cd
Fix native ESM config loading in v3 (#18938)
Unfortunately for backwards compatibility purposes (with `loadConfig` at
least) we can't switch things to use `import(…)` because there's baked
in knowledge that the config is loaded synchronously for v3.

This PR does two things:
- Defers to `require(…)` which allows newer versions that support
`require(esm)` to work natively. This works around the need to switch to
`import(…)` for those versions.
- Allows newer versions of `postcss-load-config` enabling better
ESM+TypeScript support for PostCSS configs in the CLI.

We support v4, v5, and v6 of `postcss-load-config` simultaneously so any
of those versions should work. I've verified that newer node versions
seem to install v6 while earlier ones like Node v14 install v4 of
`postcss-load-config`. So this should be a backwards compatible change.

- [x] needs tests for `import.meta.resolve(…)`
- [x] needs tests for ESM postcss configs

Fixes #14152
Fixes #14423
2025-09-16 14:03:09 -04:00
..
content-resolution Warn when broad glob patterns are used in the content configuration (#14140) 2024-08-07 16:55:20 +02:00
parcel Fix require.cache error when loaded through a typescript file in Node 22.18+ (#18665) 2025-08-22 12:44:51 -04:00
postcss-cli Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
rollup Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
rollup-sass Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
tailwindcss-cli Fix native ESM config loading in v3 (#18938) 2025-09-16 14:03:09 -04:00
vite Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
webpack-4 Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
webpack-5 Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
.gitignore Integrations setup (#4354) 2021-05-18 11:21:35 -04:00
execute.js Warn when broad glob patterns are used in the content configuration (#14140) 2024-08-07 16:55:20 +02:00
io.js Warn when broad glob patterns are used in the content configuration (#14140) 2024-08-07 16:55:20 +02:00
package.json Setup integration tests (#5466) 2021-09-14 16:18:14 +02:00
resolve-tool-root.js Integrations setup (#4354) 2021-05-18 11:21:35 -04:00
syntax.js Improve css expectations in tests (#5819) 2021-10-18 12:08:48 +02:00