timonweb / django-tailwind

Django + Tailwind CSS = 💚
https://django-tailwind.readthedocs.io
MIT License
1.45k stars 89 forks source link

Would Standalone CLI make configuration easier? #140

Open jefftriplett opened 2 years ago

jefftriplett commented 2 years ago

Not an issue or a bug, but more of a discussion (aka feel free to guilt-free close)

TailwindCSS released their Standalone CLI: Use Tailwind CSS without Node.js version a while back which has quickly become my preferred means to run TailwindCSS. My backup is npx tailwindcss.

I was curious if it would make a good addition to this project instead of requiring NPM to be installed? This might also make it easier for some of us to use in Docker, where we might not have NPM and JS configured.

I'm told Playwright does a similar technique where they bundle node with the project and install browsers as needed.

Anyways, I appreciate your work on the project and mostly wanted to brain dump since it's been on my mind for a while.

shaenr commented 2 years ago

Related/similar issue. #125

I will be trying this out personally and potentially switching over to it if it works well... to reduce the headroom that involving Node in a dockerized build step includes.

https://tailwindcss.com/blog/standalone-cli

we’re actually using pkg, a really cool project by Vercel that lets you turn a Node.js project into an executable that can be run without installing Node.js by bundling all of the parts your project needs right into the executable itself. This is what makes it possible for you to still use a tailwind.config.js file with the full power of JavaScript, rather than a static format like JSON.

We’ve even bundled the latest versions of all of our first-party plugins, so if you want to use them in your project, just require them in your tailwind.config.js file like you would in a Node-based project:

So, maybe it's possible to bundle things in a similar way that django-tailwind wants to use...

Also, there is this #141