## 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. --------- Co-authored-by: Robin Malfait <malfait.robin@gmail.com> |
||
|---|---|---|
| .. | ||
| src | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| tsup.config.ts | ||
A utility-first CSS framework for rapidly building custom user interfaces.
Documentation
For full documentation, visit tailwindcss.com.
Community
For help, discussion about best practices, or feature ideas:
Discuss Tailwind CSS on GitHub
Contributing
If you're interested in contributing to Tailwind CSS, please read our contributing docs before submitting a pull request.
@tailwindcss/webpack
A webpack loader for Tailwind CSS v4.
Installation
npm install @tailwindcss/webpack
Usage
// webpack.config.js
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
module.exports = {
plugins: [new MiniCssExtractPlugin()],
module: {
rules: [
{
test: /\.css$/i,
use: [MiniCssExtractPlugin.loader, 'css-loader', '@tailwindcss/webpack'],
},
],
},
}
Then create a CSS file that imports Tailwind:
/* src/index.css */
@import 'tailwindcss';
Options
base
The base directory to scan for class candidates. Defaults to the current working directory.
{
loader: '@tailwindcss/webpack',
options: {
base: process.cwd(),
},
}
optimize
Whether to optimize and minify the output CSS. Defaults to true in production mode.
{
loader: '@tailwindcss/webpack',
options: {
optimize: true, // or { minify: true }
},
}