Skip to content
This repository was archived by the owner on Aug 26, 2024. It is now read-only.

Commit 6696078

Browse files
authored
Update README.md
Fix possible purgeCSS issue
1 parent 9927615 commit 6696078

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,23 @@ Be sure to set the [mode](https://vuejs.org/v2/guide/transitions.html#Transition
3434
</transition>
3535
```
3636

37+
### purgeCSS fix
38+
In some cases, the animations would work during development, but not when you build and deploy to production. This issue is most likely with purgeCSS or any other optimization tool. especially if you use Nuxt.js and TailwindCSS module.
39+
40+
**To fix the issue:**
41+
In your purgeCSS config, you have to whitelist every animation class you use in your app. If you use the `fade-x` animation for example, add a regexe pattern for purgeCSS to ignore any css class that will include `fade-x` in it's name.
42+
43+
in `nuxt.config.js`:
44+
45+
```js
46+
export default {
47+
purgeCSS: {
48+
whitelistPatterns: [/fade-x/]
49+
}
50+
}
51+
52+
```
53+
3754
## Contributors ✨
3855

3956
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

0 commit comments

Comments
 (0)