Skip to content

Add Rspack optional peer dependency for @tailwindcss/webpack#20027

Open
chenjiahan wants to merge 2 commits intotailwindlabs:mainfrom
chenjiahan:add_rspack_peer
Open

Add Rspack optional peer dependency for @tailwindcss/webpack#20027
chenjiahan wants to merge 2 commits intotailwindlabs:mainfrom
chenjiahan:add_rspack_peer

Conversation

@chenjiahan
Copy link
Copy Markdown

Summary

This PR makes Rspack support explicit for @tailwindcss/webpack by adding @rspack/core as an optional peer dependency alongside webpack.

The loader already works through Rspack's webpack-compatible loader API, as shown in this runnable example: https://github.com/rstackjs/rstack-examples/tree/main/rspack/tailwindcss. The README and package description are updated to document that usage.

Test plan

No Rspack-specific tests were added. The loader implementation is unchanged, and the existing webpack loader tests exercise the same loader API path that Rspack uses, which should cover the relevant behavior.

Copilot AI review requested due to automatic review settings May 8, 2026 14:07
@chenjiahan chenjiahan requested a review from a team as a code owner May 8, 2026 14:07
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 8, 2026

Confidence Score: 5/5

Safe to merge — no loader logic was changed and the additions are metadata and documentation only.

The change touches only package.json metadata (peer dependency declarations), documentation, and the lockfile. The loader implementation itself is untouched, so existing webpack behaviour is unaffected. The open questions about webpack becoming optional and the ESM-only config example were already raised in earlier review threads.

No files require special attention beyond what was discussed in earlier review threads.

Reviews (2): Last reviewed commit: "fix: apply review feedback" | Re-trigger Greptile

Comment thread packages/@tailwindcss-webpack/package.json
Comment thread packages/@tailwindcss-webpack/README.md
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 8, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 9ed1af91-8150-48f9-974f-eebd6d0ba177

📥 Commits

Reviewing files that changed from the base of the PR and between 96206a1 and 35f7513.

📒 Files selected for processing (1)
  • packages/@tailwindcss-webpack/README.md
✅ Files skipped from review due to trivial changes (1)
  • packages/@tailwindcss-webpack/README.md

Walkthrough

This PR updates the @tailwindcss/webpack package to declare explicit support for Rspack alongside webpack. The package.json is updated to list both webpack and Rspack as optional peer dependencies with specified version ranges and metadata marking them as optional. The README is expanded with a new Rspack subsection and adds a configuration example demonstrating how to set up the loader in an rspack.config.js file, paralleling the existing webpack documentation.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding Rspack as an optional peer dependency for the @tailwindcss/webpack package.
Description check ✅ Passed The description clearly explains the PR's purpose, approach, and rationale, relating directly to the changeset of adding Rspack support documentation and peer dependency declarations.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/`@tailwindcss-webpack/package.json:
- Around line 47-53: The package marks both "webpack" and "@rspack/core" as
optional peer dependencies in packages/@tailwindcss-webpack/package.json, so add
a clear note to the README installation section for the `@tailwindcss/webpack`
package that users must install at least one bundler (either webpack or
`@rspack/core`) before using the loader; update the installation/usage docs
(README) to state this requirement, show example install commands for both
options (npm/yarn/pnpm), and warn that omitting both will cause a runtime error
when the loader (the `@tailwindcss/webpack` package) is invoked.

In `@packages/`@tailwindcss-webpack/README.md:
- Around line 73-88: The example in rspack.config.js uses ESM import/export
(import { rspack } from '@rspack/core'; export default { ... }) which will throw
for projects without "type": "module"; fix by changing the snippet to a CommonJS
form (use require('...') and module.exports = ...) or instruct readers to rename
the file to rspack.config.mjs or add "type": "module" in package.json; update
the README around the rspack and CssExtractRspackPlugin example to present one
of these safe alternatives and mention the requirement for ESM if keeping
import/export.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ccad69dd-9633-4f57-9ac9-9a12096e15d3

📥 Commits

Reviewing files that changed from the base of the PR and between c00da89 and 96206a1.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • packages/@tailwindcss-webpack/README.md
  • packages/@tailwindcss-webpack/package.json

Comment thread packages/@tailwindcss-webpack/package.json
Comment thread packages/@tailwindcss-webpack/README.md
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR makes Rspack support explicit for @tailwindcss/webpack by documenting Rspack usage and adding @rspack/core as an optional peer dependency so Rspack projects don’t see incorrect peer warnings.

Changes:

  • Update @tailwindcss/webpack README and package description to mention Rspack support and provide a Rspack config example.
  • Add @rspack/core as an optional peer dependency for @tailwindcss/webpack (and mark peers as optional via peerDependenciesMeta).
  • Update pnpm-lock.yaml to include @rspack/core and its resolved dependencies.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 4 comments.

File Description
pnpm-lock.yaml Adds lock entries for @rspack/core and associated packages as part of making Rspack support explicit.
packages/@tailwindcss-webpack/README.md Documents Rspack usage alongside webpack and updates the short package description text.
packages/@tailwindcss-webpack/package.json Updates package description and declares @rspack/core (and webpack) in peer dependency metadata.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/@tailwindcss-webpack/package.json
Comment thread packages/@tailwindcss-webpack/README.md Outdated
Comment thread packages/@tailwindcss-webpack/README.md
Comment thread pnpm-lock.yaml
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