Difference between config.tailwind.cjs and config.tailwind.js #1999
Replies: 4 comments 5 replies
-
For what it's worth, we've also had to wrap TWE scripts (like Sidenav) in additional code to prevent loading it until after the page finishes loading. This is needed to stop errors from variables coming back as undefined. |
Beta Was this translation helpful? Give feedback.
-
Hi! If there are no errors, the IDE or console doesn't throw messages about using commonJS / require not beeing defined then it's fine. I can see that the As of the scripts needed to be wrapped in additional code, it's hard for me to say, because I just created a new app with use of the Getting Started / Vite guide, and it doesn't throws errors for me. What stack are you using? What type is the the script you are using to import the TW Elements package? Im using it inside the |
Beta Was this translation helpful? Give feedback.
-
Yep, |
Beta Was this translation helpful? Give feedback.
-
@juujisai hello |
Beta Was this translation helpful? Give feedback.
-
Hi, we're starting a rebuild of an old project. This will be our third large platform in Laravel, but the first using TW and Vite. Myself and my 3 member team have 35 years of coding experience between us, so we're not newbs, but this is kind of baffling.
We are having some configuration problems, and they may mostly be confusion about conflicting docs.
When referencing Tailwindcss.com everything references the congif.tailwind.JS file (caps for focus).
But in Tailwinds Elements, for example, they reference their stuff being added to that file, but if using Vite, which we are, that there is new stuff that needs to be added to a config.taildwind.CJS file.
They state that npx tailwindcss init -p will create tailwind.config.cjs file, but it does not. It's starting to seem that these two files are actually the same file, though referenced in docs as if they are different. Is there a difference? And if so, how do we fix that the CJS file is not being created?
Is there a source of clarity on this someone can point a finger to?
It's also possible we're missing something else, though we've carefully followed all the instructions for TW, Vite and TWE.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions