Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion packages/@tailwindcss-webpack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ If you're interested in contributing to Tailwind CSS, please read our [contribut

## @tailwindcss/webpack

A webpack loader for Tailwind CSS v4.
A webpack / Rspack loader for Tailwind CSS v4.

## Installation

Expand All @@ -49,6 +49,8 @@ npm install @tailwindcss/webpack

### Usage

- webpack:

Comment thread
chenjiahan marked this conversation as resolved.
```javascript
// webpack.config.js
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
Expand All @@ -66,6 +68,25 @@ module.exports = {
}
```

- Rspack:

```javascript
// rspack.config.mjs
import { rspack } from '@rspack/core'

export default {
plugins: [new rspack.CssExtractRspackPlugin()],
module: {
rules: [
{
test: /\.css$/i,
use: [rspack.CssExtractRspackPlugin.loader, 'css-loader', '@tailwindcss/webpack'],
Comment thread
chenjiahan marked this conversation as resolved.
},
],
},
}
```
Comment thread
chenjiahan marked this conversation as resolved.
Comment thread
chenjiahan marked this conversation as resolved.

Then create a CSS file that imports Tailwind:

```css
Expand Down
13 changes: 11 additions & 2 deletions packages/@tailwindcss-webpack/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tailwindcss/webpack",
"version": "4.3.0",
"description": "A webpack loader for Tailwind CSS v4.",
"description": "A webpack / Rspack loader for Tailwind CSS v4.",
"license": "MIT",
"repository": {
"type": "git",
Expand Down Expand Up @@ -41,6 +41,15 @@
"webpack": "catalog:"
},
"peerDependencies": {
"webpack": "^5"
"@rspack/core": "^1.0.0 || ^2.0.0",
"webpack": "^5.0.0"
},
"peerDependenciesMeta": {
"@rspack/core": {
"optional": true
},
"webpack": {
"optional": true
}
Comment thread
chenjiahan marked this conversation as resolved.
Comment thread
chenjiahan marked this conversation as resolved.
}
Comment thread
chenjiahan marked this conversation as resolved.
}
120 changes: 120 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.