Add Rspack optional peer dependency for @tailwindcss/webpack#20027
Add Rspack optional peer dependency for @tailwindcss/webpack#20027chenjiahan wants to merge 2 commits intotailwindlabs:mainfrom
Conversation
Confidence Score: 5/5Safe 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 |
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
WalkthroughThis PR updates the 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ 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.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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. Comment |
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (2)
packages/@tailwindcss-webpack/README.mdpackages/@tailwindcss-webpack/package.json
There was a problem hiding this comment.
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/webpackREADME and package description to mention Rspack support and provide a Rspack config example. - Add
@rspack/coreas an optional peer dependency for@tailwindcss/webpack(and mark peers as optional viapeerDependenciesMeta). - Update
pnpm-lock.yamlto include@rspack/coreand 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.
Summary
This PR makes Rspack support explicit for
@tailwindcss/webpackby adding@rspack/coreas an optional peer dependency alongsidewebpack.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.