Skip to content
Merged
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
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,30 @@ export default {

Note that `picomatch` patterns are very similar to [`minimatch`](https://github.com/isaacs/minimatch#readme) patterns, and in most use cases, they are interchangeable. If you have more specific pattern matching needs, you can view [this comparison table](https://github.com/micromatch/picomatch#library-comparisons) to learn more about where the libraries differ.

### `tailwindcssPath`

Specifies the absolute path to the tailwindcss package.

By default, tailwindcss is resolved using Node.js module resolution algorithm starting from the root path.

This option allows explicit specification of the tailwindcss package location for scenarios where automatic resolution fails or the resolved path is not correct, such as in monorepo.

- Type: `string | undefined`
- Default: `undefined`

```js
// rsbuild.config.ts
import { pluginTailwindCSS } from 'rsbuild-plugin-tailwindcss'

export default {
plugins: [
pluginTailwindCSS({
tailwindcssPath: require.resolve('tailwindcss'),
}),
],
};
```

## Debugging

Use `DEBUG='rsbuild'` to enable debugging mode for the plugin. When debugging is enabled, the plugin will:
Expand Down
8 changes: 2 additions & 6 deletions src/TailwindCSSRspackPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ interface TailwindRspackPluginOptions {
* Specifies the absolute path to the tailwindcss package.
*
* By default, tailwindcss is resolved using Node.js module resolution algorithm
* starting from the project's root directory. This option allows explicit
* starting from the root path. This option allows explicit
* specification of the tailwindcss location for scenarios where automatic
* resolution fails or the resolved path is not correct, such as in monorepo.
*
Expand All @@ -160,11 +160,7 @@ interface TailwindRspackPluginOptions {
* export default {
* plugins: [
* new TailwindRspackPlugin({
* postcssOptions: {
* plugins: {
* tailwindcssPath: require.resolve('tailwindcss'),
* },
* },
* tailwindcssPath: require.resolve('tailwindcss'),
* }),
* ],
* }
Expand Down
14 changes: 5 additions & 9 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,22 +117,18 @@ export interface PluginTailwindCSSOptions {
* Specifies the absolute path to the tailwindcss package.
*
* By default, tailwindcss is resolved using Node.js module resolution algorithm
* starting from the project's root directory. This option allows explicit
* starting from the root path. This option allows explicit
* specification of the tailwindcss location for scenarios where automatic
* resolution fails or the resolved path is not correct, such as in monorepo.
*
* ```js
* // rspack.config.js
* import { TailwindRspackPlugin } from 'rsbuild-plugin-tailwindcss'
* // rsbuild.config.js
* import { pluginTailwindCSS } from 'rsbuild-plugin-tailwindcss'
*
* export default {
* plugins: [
* new TailwindRspackPlugin({
* postcssOptions: {
* plugins: {
* tailwindcssPath: require.resolve('tailwindcss'),
* },
* },
* pluginTailwindCSS({
* tailwindcssPath: require.resolve('tailwindcss'),
* }),
* ],
* }
Expand Down