tailwindcss/integrations/vite
Philipp Spiess 7347a2fd1c
Vite: Use Vite resolvers for CSS and JS files (#15173)
Closes #15159

This PR extends the `@tailwindcss/node` packages to be able to overwrite
the CSS and JS resolvers. This is necessary as some bundlers, in
particular Vite, have a custom module resolution system that can be
individually configured. E.g. in Vite it is possible to add custom
[resolver
configs](https://vite.dev/config/shared-options.html#resolve-conditions)
that is expected to be taken into account.

With the new `customCssResolver` and `customJsResolver` option, we're
able to use the Vite resolvers which take these configs into account.

## Test Plan

Tested in the playground by configuring [resolver
conditions](https://vite.dev/config/shared-options.html#resolve-conditions)
(with Vite 5.4 and Vite 6 beta). An integration test was added for both
the JS and CSS resolvers to ensure it keeps working as expected.

---------

Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
2024-11-27 11:48:55 -05:00
..
astro.test.ts Revert "Fix Astro integration test by pinning zod-to-json-schema" (#14792) 2024-10-25 11:31:34 +02:00
config.test.ts Update Vite to 6.0 (#15197) 2024-11-27 11:34:50 -05:00
css-modules.test.ts Update Vite to 6.0 (#15197) 2024-11-27 11:34:50 -05:00
index.test.ts Update Vite to 6.0 (#15197) 2024-11-27 11:34:50 -05:00
multi-root.test.ts Update Vite to 6.0 (#15197) 2024-11-27 11:34:50 -05:00
nuxt.test.ts Fix glob pattern hoisting on Windows (#14904) 2024-11-07 15:31:06 -05:00
other-transforms.test.ts Update Vite to 6.0 (#15197) 2024-11-27 11:34:50 -05:00
resolvers.test.ts Vite: Use Vite resolvers for CSS and JS files (#15173) 2024-11-27 11:48:55 -05:00
svelte.test.ts Update Vite to 6.0 (#15197) 2024-11-27 11:34:50 -05:00
url-rewriting.test.ts Update Vite to 6.0 (#15197) 2024-11-27 11:34:50 -05:00
vue.test.ts Update Vite to 6.0 (#15197) 2024-11-27 11:34:50 -05:00