-
-
Notifications
You must be signed in to change notification settings - Fork 172
Resolve tailwindcss
relative to the file being processed
#386
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
Conversation
5253d6e
to
a14691d
Compare
a14691d
to
e07af2e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, a few small questions/suggestions.
The src/config.ts
file reads very nicely right now.
I think technically this change could be a breaking change, but for people with simple setups looking for tailwindcss from the config or input file shouldn't result in any differences. But for people with a more complex (monorepo) setup it should solve locating tailwindcss
correctly.
Running into some issues with this PR, let's discuss this on Tuple later 👍
The last release was over 5 years ago
Co-authored-by: Robin Malfait <[email protected]>
f7fc236
to
827e5f2
Compare
Breaking change
tailwindcss
is now resolved relative to each processed fileLoading the
tailwindcss
version relative to each processed file produces more correct behavior for monorepos wheretailwindcss
may not be installed at the project root but instead in a subdirectory. Because of this projects with multiple Tailwind CSS versions in the same repo are also more likely to work than before.Automatically loaded v3 configs are resolved relative to each processed file
Similar to the above, the same happens when we automatically locate your v3-style config files. Previously these were always searched for relative to the Prettier config — this often meant the file needed to be in the project root. This is no longer the case which should improve support for monorepos with multiple configs using Tailwind CSS v3.
This ended up turning into a complete rework of the module and config loading. There's definitely going to be some different perf characteristics because some things are loaded relative to an input file now but it's hopefully minimal.
Will need to do lots of perf testing on a large codebase — esp with lots of embedded languages/expressions (e.g. large Vue files).
Closes #243 (since the implementation is now entirely different but does the same thing)
Fixes #340
Closes #361
Closes #363
Closes #369