Hey guys,
I’m trying to customize a WooCommerce template (cart.php
) with Tailwind classes. I copied the source template from the plugin’s folder into mysagetheme/woocommerce/cart/cart.php
But:
- hot reloading is not working, despite the fact that it works when editing
.blade
files
- the Tailwind compiler seems oblivious to the fact that I’m adding Tailwind CSS classes to the code of the
cart.php
WooCommerce file.
How could I make aware both Vite (for hot reloading), and the Tailwind compiler (for CSS code compilation) of the fact that I am customizing WooCommerce template .php
files?
Any suggestions would be greatly appreciated.
Many thanks.
Update: I fixed hot reloading for .php
files by replacing refresh: true
in vite.config.js
with
refresh: [
'resources/views/**/*.blade.php',
'resources/**/*.js',
'resources/**/*.vue',
'./**/*.php', // Watch .php files for changes
],
If only I could make the Tailwind compiler be aware of changes inside my .php
file, that would be perfect.
Any thoughts?
@csorrentino you saved my day (and lightning fast!) 
It all makes sense as to why my attempts to use tailwind.config.js
to specify the sources could never have worked. My old Tailwind 3.x habits die hard 
But yeah, I’m loving Tailwind 4.x more and more. Today I learned something new. And for that I am grateful to you, Sir.
Chapeau.
1 Like