Skip to content

Commit 8ccd201

Browse files
committed
docs(react): adjust Tailwind guide for React
Related issues: #6369
1 parent 8b1f812 commit 8ccd201

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

nx-dev/nx-dev/public/documentation/latest/react/guides/using-tailwind-css-in-react.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ Nx has a utility function for determining the glob representation of all files t
4646
const { createGlobPatternsForDependencies } = require('@nrwl/react/tailwind');
4747

4848
module.exports = {
49-
purge: createGlobPatternsForDependencies(__dirname),
49+
purge: [
50+
// place your own app's glob pattern (for example)
51+
'./apps/{your app here}/src/**/*.{js,ts,jsx,tsx}',
52+
...createGlobPatternsForDependencies(__dirname),
53+
],
5054
darkMode: false, // or 'media' or 'class'
5155
theme: {
5256
extend: {},
@@ -58,6 +62,8 @@ module.exports = {
5862
};
5963
```
6064

65+
`createGlobPatternsForDependencies(..)` uses the Nx dependency graph to generate glob patterns for all the app's **dependencies** (e.g. for all referenced libraries within the Nx workspace).
66+
6167
_NOTE:_ To ensure proper purging for custom configurations, be sure that the `NODE_ENV` environment variable is set to `production`. By default, Nx only purges on prod build (for example: `nx build --prod`).
6268

6369
## Step 3: Import TailwindCss Styles

0 commit comments

Comments
 (0)