
Research
Security News
The Landscape of Malicious Open Source Packages: 2025 Mid‑Year Threat Report
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
rsbuild-plugin-tailwindcss
Advanced tools
An Rsbuild plugin to integrate with [Tailwind CSS](https://tailwindcss.com/) V3.
An Rsbuild plugin to integrate with Tailwind CSS V3.
Tailwind CSS is able to remove unused CSS classes through Content Configuration. However, its accuracy may be insufficient when:
This plugin uses the Rspack module graph to override the content
configuration with imported modules, generating Tailwind CSS output based on usage.
Install:
npm add tailwindcss@3 rsbuild-plugin-tailwindcss -D
Add plugin to your rsbuild.config.ts
:
// rsbuild.config.ts
import { pluginTailwindCSS } from "rsbuild-plugin-tailwindcss";
export default {
plugins: [pluginTailwindCSS()],
};
Create a tailwind.config.js
file at the root of the project:
/** @type {import('tailwindcss').Config} */
export default {
theme: {
colors: {
blue: "#1fb6ff",
purple: "#7e5bef",
pink: "#ff49db",
orange: "#ff7849",
green: "#13ce66",
yellow: "#ffc82c",
"gray-dark": "#273444",
gray: "#8492a6",
"gray-light": "#d3dce6",
},
},
};
This will be auto-loaded by Rsbuild and applied by rsbuild-plugin-tailwindcss
.
[!NOTE]
You don't need to add
content
in thetailwind.config.js
.rsbuild-plugin-tailwindcss
will add the imported modules for you.
Create a postcss.config.js
file at the root of the project:
export default {
plugins: {
cssnano: process.env["NODE_ENV"] === "production" ? {} : false,
},
};
[!NOTE]
You don't need to add
tailwindcss
in thepostcss.config.js
.rsbuild-plugin-tailwindcss
will add the plugin for you.
Or use the tools.postcss
option in rsbuild.config.ts
.
config
string | undefined
tailwind.config.js
The path to custom Tailwind CSS configuration. Could be a relative path from the root of the project or an absolute path.
// rsbuild.config.ts
import { pluginTailwindCSS } from "rsbuild-plugin-tailwindcss";
export default {
plugins: [
pluginTailwindCSS({
config: "./config/tailwind.config.js",
}),
],
};
exclude
/ include
ReadonlyArray<string | RegExp> | string | RegExp | null | undefined
undefined
These two options are used to filter which module to be processed by Tailwind CSS using picomatch
pattern.
If include
is omitted or empty, all modules that do not match any of the exclude
patterns will be included.
Otherwise, only modules that match one or more of the include
patterns and do not match any of the exclude
patterns will be included.
Include all .js
, .jsx
, .ts
, .tsx
files but exclude files in ./src/store
and node_modules
:
// rsbuild.config.ts
import { pluginTailwindCSS } from "@byted-lynx/plugin-tailwindcss";
export default {
plugins: [
pluginTailwindCSS({
include: /\.[jt]sx?/,
exclude: ["./src/store/**", /[\\/]node_modules[\\/]/],
}),
],
};
Note that picomatch
patterns are very similar to minimatch
patterns, and in most use cases, they are interchangeable. If you have more specific pattern matching needs, you can view this comparison table to learn more about where the libraries differ.
Use DEBUG='rsbuild'
to enable debugging mode for the plugin. When debugging is enabled, the plugin will:
.rsbuild/<entry-name>
directory inside your project's output path.This is helpful for:
Example:
# For macOS/Linux
DEBUG=rsbuild npm run build
# For Windows (cmd)
set DEBUG=rsbuild && npm run build
# For Windows (PowerShell)
$env:DEBUG="rsbuild"; npm run build
You can also use more specific debug patterns:
DEBUG=rsbuild:tailwind
- Debug only the Tailwind CSS pluginDEBUG=rsbuild:*
- Debug all Rsbuild pluginsDEBUG=*
- Debug everythingThanks to:
exclude
and include
.MIT.
FAQs
An Rsbuild plugin to integrate with [Tailwind CSS](https://tailwindcss.com/) V3.
The npm package rsbuild-plugin-tailwindcss receives a total of 3,986 weekly downloads. As such, rsbuild-plugin-tailwindcss popularity was classified as popular.
We found that rsbuild-plugin-tailwindcss demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.