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

(PostCSS plugin): Add postcss to used dependencies when using PostCSS with Tailwind CSS #764

Merged
merged 3 commits into from
Aug 21, 2024

Conversation

taro-28
Copy link
Contributor

@taro-28 taro-28 commented Aug 21, 2024

Closes #762

Copy link

netlify bot commented Aug 21, 2024

‼️ Deploy request for knip rejected.

Name Link
🔨 Latest commit 3cd136f

Copy link

pkg-pr-new bot commented Aug 21, 2024

commit: 4db3279

bun add https://pkg.pr.new/knip@764

Open in Stackblitz

Copy link
Collaborator

@webpro webpro left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @taro-28! Appreciated. I do have a question, though.

const resolve: Resolve<PostCSSConfig> = async (options, config) => {
for (const plugin of await resolveConfig(options, config)) {
// Because postcss is not included in peerDependencies of tailwindcss
if (plugin === 'tailwindcss') return ['postcss'];
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the reason for not adding a check for tailwindcss in config.plugins to the resolveConfig function directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I misunderstood the implementation policy🙏

FIxed!
03a7583

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, there was a mistake.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry taro. Is there anything in the documentation or code that could have prevented this? Maybe we can improve it for the next contributor.

Thanks for the fix!

Copy link
Contributor Author

@taro-28 taro-28 Aug 21, 2024

Choose a reason for hiding this comment

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

Sorry, there was a mistake.

Re-fixed!

Sorry taro. Is there anything in the documentation or code that could have prevented this? Maybe we can improve it for the next contributor.

I re-read the documentation again, and it succinctly describes how to use resolveConfig, so I thought it was fine as it is.

My misunderstanding was due to overcomplicating the issue, as it was a slightly exceptional modification, such as adding the plugin's dependency itself (postcss).

@taro-28 taro-28 force-pushed the add-resolve-to-postcss-plugin branch from 7d649cc to 03a7583 Compare August 21, 2024 11:07
@taro-28 taro-28 force-pushed the add-resolve-to-postcss-plugin branch from 03a7583 to d56b911 Compare August 21, 2024 11:12
@taro-28 taro-28 marked this pull request as ready for review August 21, 2024 11:29
@taro-28 taro-28 force-pushed the add-resolve-to-postcss-plugin branch from a889af7 to 4db3279 Compare August 21, 2024 13:03
@webpro webpro merged commit 23526a9 into webpro-nl:main Aug 21, 2024
14 checks passed
@webpro
Copy link
Collaborator

webpro commented Aug 21, 2024

Thank you! 🙏

@webpro
Copy link
Collaborator

webpro commented Aug 21, 2024

🚀 This pull request is included in v5.27.3. See Release 5.27.3 for release notes.

Using Knip in a commercial project? Please consider becoming a sponsor.

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.

(PostCSS plugin): Add postcss to referencedDependencies when using Tailwind CSS with PostCSS
2 participants