A configuration to use Vite with PHP and TailwindCSS to refresh the browser when a file is changed. Base on Laravel vite plugin.
npm installFirst run Tailwindcss to watch for changes in the CSS of your templates files.
npm run tail-watchThe templates files are in the resources/views directory.
The base css file is in resources/css/app.css.
The build css file is in public/css/app.css.
Then run Vite to watch for changes in the JS files.
npm run devYou only need the @vite/client in your main layout(s) resources/views/layouts/app.layout.php file. ver más
Finally, run the PHP server.
php -S localhost:8000Let the all three commands running and start coding.