Closed MZanggl closed 4 years ago
(repost from https://github.com/nuxt/nuxt.js/issues/7197)
v2.12.2
https://github.com/MZanggl/nuxt-tailwind-config-purge-bug
Running npm run dev you will see the page displaying a blue background. This is because I added
npm run dev
bodyAttrs: { class: 'bg-blue-200' }
in nuxt.config.js.
nuxt.config.js
Running npm run generate and opening the generated files just returns a white background as the class bg-blue-200 got purged.
npm run generate
bg-blue-200
classes inside nuxt.config.js get detected by purgeCSS.
purgeCSS does not take class names in nuxt.config.js into consideration so it accidentally purges these classes.
(repost from https://github.com/nuxt/nuxt.js/issues/7197)
Version
v2.12.2
Reproduction link
https://github.com/MZanggl/nuxt-tailwind-config-purge-bug
Steps to reproduce
Running
npm run dev
you will see the page displaying a blue background. This is because I addedin
nuxt.config.js
.Running
npm run generate
and opening the generated files just returns a white background as the classbg-blue-200
got purged.What is expected ?
classes inside nuxt.config.js get detected by purgeCSS.
What is actually happening?
purgeCSS does not take class names in nuxt.config.js into consideration so it accidentally purges these classes.