Home > front end >  Laravel 9 Tailwindcss always must npm run dev after code change
Laravel 9 Tailwindcss always must npm run dev after code change

Time:06-08

I have installed Tailwindcss on Laravel 9 and the problem is that whatever I change in the code in the blade.php files, Tailwindcss does not work. Only when I run npm run dev and refresh the page, the effect is visible. Why after each code change in laravel blade files I have to do npm run dev otherwise tailwindcss does not work as if it does not recognize its classes.

CodePudding user response:

Run npm run watch to watch for changes and recompile your styles and scripts when you save.

The npm run watch command will continue running in your terminal and watch all relevant CSS and JavaScript files for changes. Webpack will automatically recompile your assets when it detects a change to one of these files:

Read more about it here: https://laravel.com/docs/9.x/mix#watching-assets-for-changes

  • Related