Feature: install Tailwind plugins without npm #31
Replies: 2 comments
-
TBH I don't know where to even start to make this work without npm, so I'd love if someone was able to suggest a path forward. The upstream docs for the imminent v4 haven't really changed much about how plugins are handled:
My interpretation is that |
Beta Was this translation helpful? Give feedback.
-
I don’t fully understand what problem is being highlighted here or exactly what sort of dependency upon npm needs to be avoided. To recap, I think the basic process of introducing a Tailwind CSS plugin (say daisyUI) is:
I don’t know of a good way to avoid step 1, since plugins like daisyUI are de facto distributed as npm packages and it seems like it’d be painful to try to retrieve them in some other way. But, in case it’s helpful, one way to avoid step 4 (i.e. introducing npm as a development dependency for everyone else on the team) is to use a JavaScript module bundler (e.g. esbuild) to vendor a self-contained version of the desired plugin and commit that to source control. The Tailwind CSS configuration can then For example, in a Rails app:
Again, this obviously still requires npm at vendoring time, but once the vendored plugin is checked into source control you don’t need npm any more. For all I know this might be a completely wrongheaded approach but it gets the job done. |
Beta Was this translation helpful? Give feedback.
-
Picking up from bradgessler's issue: rails/tailwindcss-rails#421 (comment)
Thanks all!
Beta Was this translation helpful? Give feedback.
All reactions