Skip to content
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

feat: add ignore option to tailwind plugin #17482

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AlemTuzlak
Copy link
Contributor

@AlemTuzlak AlemTuzlak commented Apr 1, 2025

Added an optional ignore flag for the tailwind plugin to ignore certain files and allow for easier configuration with other plugins

Needed for better interop with other plugins, eg:
#16712

@AlemTuzlak AlemTuzlak requested a review from a team as a code owner April 1, 2025 12:37
return matcher(id);
}

return matcher.includes(matcher)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what to do in this case if it's a string, or if you want to support this use-case at all, maybe it would make sense to offload it to the user with the matcher function above

@AlemTuzlak
Copy link
Contributor Author

Not sure if tests are needed? ready to write any if yes!

@philipp-spiess
Copy link
Member

Hey! Thanks for the PR but I think it would be even better if we can allow these plugins without requiring a configuration option. Do you have a repro for one specific example? The discussion you linked two has two issues one from @shopify/polaris (where I can't find a .css file that contains JS code?) and one for vanialla.css that I also can't find more information about. Would be good to understand how there are .css files that contain JS modules in the first place and if there's maybe a way in the Vite plugin to detect that (i.e usually these might contain some query parameters in the module ID).

@AlemTuzlak
Copy link
Contributor Author

That would probably be the ideal outcome, although not sure if it's realistic as that's what vanilla extract tried to do as well and ran into interop issues with a few plugins and gave up on it, not saying it will happen to tailwind but it's a possibility, I'll create a repro for vanilla, the other one I'm not really familiar with and can't be of much help there, but I'm guessing you run into it as soon as you use polaris to generate css. For vanilla I know their vite plugin listens to .css.ts files then outputs .vanilla.css files in dev so then tailwind tries to parse them and results in the site crashing as it considers it invalid css.

@AlemTuzlak
Copy link
Contributor Author

@philipp-spiess sorry for the wait, here's a vanilla repro:
https://github.com/AlemTuzlak/underkill-stack
Not sure if it would solve all the issues with vanilla by fixing this one as the error i've seen is a different error message than this one but it's a great start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants