tailwindcss/integrations/vite
Robin Malfait 685c19e266
Fix issue around resolving paths in @tailwindcss/vite (#19947)
This PR fixes an issue when using `@tailwindcss/vite` and you're trying
to resolve paths. In the latest 4.2.3 release, we added support for
following the vite `aliases` option.

However, some people run into issues because if you just use `@` as an
alias then using `@tailwindcss/typography` wouldn't resolve because it's
a package, and not something local.

With this PR we fix that by making sure that Vite's resolver can
actually resolve to an absolute path. If not, then we fallback to the
resolving that happens in `@tailwindcss/node`.

Fixes: #19946

## Test plan

1. Added an integration test that reproduces this issue, and is now
solved
2. Tested it on a reproduction provided in the corresponding issue

Before:
<img width="1694" height="1856" alt="image"
src="https://github.com/user-attachments/assets/c50f7104-78b3-476d-9e60-0c83e0976a5c"
/>


After:
<img width="1694" height="1856" alt="image"
src="https://github.com/user-attachments/assets/44ea0e3b-f60f-479f-a4a1-203a6230475b"
/>
2026-04-21 14:11:46 +02:00
..
astro.test.ts Fallback to config.createResolver for client and ssr environments in @tailwindcss/vite (#19679) 2026-02-17 19:59:57 +00:00
config.test.ts feat: add Vite 7 support to the @tailwindcss/vite plugin (#18384) 2025-06-24 12:31:17 -04:00
css-modules.test.ts feat: add Vite 7 support to the @tailwindcss/vite plugin (#18384) 2025-06-24 12:31:17 -04:00
html-style-blocks.test.ts feat: add Vite 7 support to the @tailwindcss/vite plugin (#18384) 2025-06-24 12:31:17 -04:00
ignored-packages.test.ts feat: add Vite 7 support to the @tailwindcss/vite plugin (#18384) 2025-06-24 12:31:17 -04:00
index.test.ts Add support for Vite 8 in @tailwindcss/vite (#19790) 2026-03-12 20:54:34 +01:00
multi-root.test.ts feat: add Vite 7 support to the @tailwindcss/vite plugin (#18384) 2025-06-24 12:31:17 -04:00
nuxt.test.ts bump nuxt dependency in integration tests 2026-01-06 16:17:55 +01:00
other-transforms.test.ts feat: add Vite 7 support to the @tailwindcss/vite plugin (#18384) 2025-06-24 12:31:17 -04:00
qwik.test.ts Vite: Don't register the current CSS file as a dependency on itself (#17533) 2025-04-03 18:50:16 +02:00
react-router.test.ts Cleanup inconsistencies related to (regex) escapes (#19804) 2026-03-15 22:04:58 +01:00
resolvers.test.ts Fix issue around resolving paths in @tailwindcss/vite (#19947) 2026-04-21 14:11:46 +02:00
solidstart.test.ts Fix Vite issues with SolidStart (#16052) 2025-01-30 16:58:20 +01:00
source-maps.test.ts feat: add Vite 7 support to the @tailwindcss/vite plugin (#18384) 2025-06-24 12:31:17 -04:00
ssr.test.ts Add support for Vite 8 in @tailwindcss/vite (#19790) 2026-03-12 20:54:34 +01:00
svelte.test.ts Cleanup inconsistencies related to (regex) escapes (#19804) 2026-03-15 22:04:58 +01:00
sveltekit.test.ts Fix issue around resolving paths in @tailwindcss/vite (#19947) 2026-04-21 14:11:46 +02:00
url-rewriting.test.ts feat: add Vite 7 support to the @tailwindcss/vite plugin (#18384) 2025-06-24 12:31:17 -04:00
virtual-modules.test.ts Vite: Don't crash with virtual module dependencies (#16780) 2025-02-25 11:29:58 +01:00
vue.test.ts feat: add Vite 7 support to the @tailwindcss/vite plugin (#18384) 2025-06-24 12:31:17 -04:00