PurgeCSS is ignoring components registered globally

This issue has been tracked since 2023-01-21.

Tailwind classes doesn't work on components that were registered from a plugin globally. but in your local component if you add a tailwind class it will work. I think PurgeCSS is ignoring components registered globally.


@nuxtjs/tailwindcss: ^6.2.0
nuxt: ^3.0.0

Reproduction Link

branch: tailwind-issue-plugin-components

Steps to reproduce

install nuxt and create a plugin that register components globally.
From the repo link, install and run dev then go to /login in browser.

What is Expected?

The Remember Me text should have the text-blue-900. If you inspect there are no css styles to it.

What is actually happening?

I think PurgeCSS is ignoring components registered globally.

yabuking84 wrote this answer on 2023-01-24

Just solved this, on tailwind.config.ts just add
export default <Partial<Config>>{ theme: { extend: {}, }, content: [ '${srcDir}/plugins/**/*.vue' ], };

More Details About Repo
Owner Name nuxt-modules
Repo Name tailwindcss
Full Name nuxt-modules/tailwindcss
Language TypeScript
Created Date 2019-04-04
Updated Date 2023-03-29
Star Count 1285
Watcher Count 12
Fork Count 157
Issue Count 57


Issue Title Created Date Updated Date