Detect if Tailwind is installed from Nuxt Module

Hi I am building a Nuxt Module that will add some componentes to Nuxt project, and I was wondering is there an easy way to detect if the Nuxt project is using taiwlind and if it is do I have a way to extend it's config?
2 Replies
Single
Single4d ago
Yes and no: const tailwindModule = '@nuxtjs/tailwindcss' const tailwindModuleImport = await import(tailwindModule).catch(() => { '<do something>' }) As tailwind is a postCSS library which is being 'rendered' once you build, you can not change its tailwind.config during runtime - i think.
harlan
harlan4d ago
nuxt/kit has a util to check this, isNuxtModuleInstalled or something the nuxt tailwind module has a hook to override the config