-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v4] Resolve @import
or @source
from vite.resolve.alias
#15159
Comments
Hey! Agree this is an issue right now. We're already tracking this as #15047 so I'm going to merge the two issues and close this one. |
Going to reopen this one as #15047 does not repro for me so the fix will not work for the other issue. This issue is something we can fix, though. Looking into it 👀 |
This was referenced Nov 25, 2024
adamwathan
added a commit
that referenced
this issue
Nov 27, 2024
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>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of Tailwind CSS are you using?
tailwindcss: v4.0.0-beta.2
@tailwindcss/vite: v4.0.0-beta.2
@tailwindcss/postcss: v4.0.0-beta.2
What build tool (or framework if it abstracts the build tool) are you using?
vite: v5.4.11
What browser are you using?
Chrome, Safari, etc
What operating system are you using?
macOS
Reproduction URL
https://github.com/TiBianMod/vite-tailwindcss
Reproduction contains 3 Branches
main
:without tailwindcss
WORKING@tailwindcss/postcss
: WORKING@tailwindcss/vite
: NOT WORKING - ThrowsDescribe your issue
@tailwindcss/vite
Can't resolve@import
or@source
from vite.resolve.alias@tailwindcss/postcss
Can't resolve@source
from vite.resolve.aliasThe text was updated successfully, but these errors were encountered: