How to Require tailwind plugins in a Nuxt Module
From the above, what's the proper way?
I've tried to just add the plugins field:
https://github.com/jcmsj/daisyui-nuxt/blob/main/src/module.ts#L48
based on the authoring guide:
https://nuxt.com/docs/guide/going-further/modules#using-other-modules-in-your-module
I thought I got it right since it was working in the playground (see image) and I was using it in a separate project for the past week.
But today it suddenly fails to run in any project if using the npm registry. The 0.06 release was one of my attempts. Reproduction: https://codesandbox.io/p/devbox/wizardly-farrell-c72g9k I can't seem to find examples of using a tailwind plugin either. Thanks in advance!
But today it suddenly fails to run in any project if using the npm registry. The 0.06 release was one of my attempts. Reproduction: https://codesandbox.io/p/devbox/wizardly-farrell-c72g9k I can't seem to find examples of using a tailwind plugin either. Thanks in advance!
GitHub
daisyui-nuxt/src/module.ts at main · jcmsj/daisyui-nuxt
A Nuxt module for daisyUI. Contribute to jcmsj/daisyui-nuxt development by creating an account on GitHub.
4 Replies
You add tailwind modules to your tailwind.config
Daisy ui is a tailwind module. Not sure why this person made it a nuxt module lol
sorry, that's me, I'm making it so i don't have to configure tailwind then daisyui everytime
so for plugins to the Tailwind config - I would recommend generating a cjs template and passing that to configPaths of the module
an update to the TW module is already looking to make that the default expected behaviour
when you do this, as of 6.11.4, you’ll need prepare but 6.12.0 (hopefully) should streamline that
with that said, the next version of TailwindCSS should allow passing plugins as strings (I hope they release it before v4 separately soon)
if I get around to it (most likely will), I’ll help out with a PR (assuming thats your repository) 🙂
here you go! https://github.com/jcmsj/daisyui-nuxt/pull/1
Thanks, I'll try it out quite later